]> git.michaelhowe.org Git - packages/o/openafs.git/commit
ubik: update ubik_dbVersion during SDISK_SendFile
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Mon, 21 Aug 2017 19:50:14 +0000 (15:50 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 9 Feb 2018 14:07:49 +0000 (09:07 -0500)
commit1f10f087264cb39a8354c0baf71eb1fa13071466
treef91eb7944ef3dc99a51aae467fbd95655bb20a28
parente9419dc895801bda6962f2ac0f5981631a0d95c7
ubik: update ubik_dbVersion during SDISK_SendFile

The ubik_dbVersion global represents the sync site's database version
and it is mostly used by the remote sites for sanity checks. Currently,
this global is updated when database changes are made on the sync site
(SDISK_Commit or SDISK_SetVersion), as well as every time we vote "yes"
for the sync-site in a beacon reply. Unfortunately, ubik_dbVersion is
not updated when a copy of the sync site's database is received via
DISK_SendFile, and it won't get updated until our next "yes" vote.
During this window, the current database version will not match
ubik_dbVersion. As a result, any write transaction during this time
frame will fail on the remote site in question.

To fix this problem, do not wait for the next beacon packet to update
ubik_dbVersion when the sync site's database is received; just update
it when we get the new database. Since no write transactions are
allowed while the db is transferring, ubik_dbVersion can be safely
updated.

Reviewed-on: https://gerrit.openafs.org/12716
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@dson.org>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 50c1d1088d2adcbb37b6a9d23fdd63617b1267be)

Change-Id: Icbbe9efb9c8dab9ac69237380e824d4a523a53d3
Reviewed-on: https://gerrit.openafs.org/12885
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/ubik/remote.c