Quoting Jeffrey Hutzelman:
In udisk_commit(), when committing the first write transaction
after becoming sync site, the database is relabelled. In this
case, the UBIK_RECLABELDB recovery state bit should be set before
propagating the label change to other servers, rather than after.
This is because ContactQuorum_DISK_Setversion() will
release the database lock, at which point the recovery state may
be cleared by urecovery_ResetState() running in another thread.
It is important that a relabelling which occurs before recovery
state is cleared not result in the UBIK_RECLABELDB recovery state
bit being set after; otherwise, the server may fail to correctly
relabel the database the next time it becomes sync site.
Change-Id: I9753a24c84cf45cdbb11a1d8b7ab262fbe487204
Reviewed-on: http://gerrit.openafs.org/4489
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
dbase->version = newversion;
UBIK_VERSION_UNLOCK;
+ urecovery_state |= UBIK_RECLABELDB;
+
/* Ignore the error here. If the call fails, the site is
* marked down and when we detect it is up again, we will
* send the entire database to it.
*/
ContactQuorum_DISK_SetVersion( atrans, 1 /*CStampVersion */ ,
&oldversion, &newversion);
- urecovery_state |= UBIK_RECLABELDB;
}
UBIK_VERSION_LOCK;