From b2e6b426e6351da8b13e1d8b55be220fc98df5e5 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Sat, 16 Apr 2011 12:56:05 -0400 Subject: [PATCH] ubik: set UBIK_RECLABELDB before propagating version 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 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/ubik/disk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ubik/disk.c b/src/ubik/disk.c index 1048edd95..17685eccd 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -886,13 +886,14 @@ udisk_commit(struct ubik_trans *atrans) 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; -- 2.39.5