From 09c1b9d5cf5aa9249b06b9312bb5e79eb3e06dca Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 22 Jan 2015 01:14:28 -0500 Subject: [PATCH] ubik: SDISK_Begin no quorum, wrong db, no transaction When processing an DISK_Begin RPC verify that there is an active quorum and that the local database is current. Otherwise, fail the RPC with a UNOQUORUM error. The returned error must be UNOQUORUM instead of USYNC becase the returned error code will be returned by the coordinator's ContactQuorum_iterate() to the client that triggered the write transaction. Most ubik clients will only retry if the error is UNOQUORUM. FIXES 131997 Change-Id: Icaa30e6aca82e7e7d33e9171a4f023970aba61df Reviewed-on: http://gerrit.openafs.org/11689 Tested-by: BuildBot Reviewed-by: Daria Brashear Reviewed-by: Benjamin Kaduk Reviewed-by: Jeffrey Hutzelman Reviewed-by: Jeffrey Altman (cherry picked from commit d47beca13236c64ed935fabeff9d1001e8a8871f) Reviewed-on: http://gerrit.openafs.org/11773 Reviewed-by: Chas Williams <3chas3@gmail.com> Reviewed-by: Stephan Wiesand --- src/ubik/remote.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ubik/remote.c b/src/ubik/remote.c index 6dabe61c00..11bf375faa 100644 --- a/src/ubik/remote.c +++ b/src/ubik/remote.c @@ -71,6 +71,10 @@ SDISK_Begin(struct rx_call *rxcall, struct ubik_tid *atid) return code; } DBHOLD(ubik_dbase); + if (urecovery_AllBetter(ubik_dbase, 0) == 0) { + code = UNOQUORUM; + goto out; + } urecovery_CheckTid(atid); if (ubik_currentTrans) { /* If the thread is not waiting for lock - ok to end it */ @@ -89,6 +93,7 @@ SDISK_Begin(struct rx_call *rxcall, struct ubik_tid *atid) ubik_currentTrans->tid.epoch = atid->epoch; ubik_currentTrans->tid.counter = atid->counter; } + out: DBRELE(ubik_dbase); return code; }