summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoao Eduardo Luis <joao.luis@inktank.com>2013-09-25 22:08:24 +0100
committerJoao Eduardo Luis <joao.luis@inktank.com>2013-09-25 22:08:24 +0100
commitf9843b48c868c4659087dd35a4429943da0ff53f (patch)
tree6bdf37d1d5457f37ac782f74f1e3b8759ac91678
parent3de32562b55c6ece3a6ed783c36f8b9f21460339 (diff)
downloadceph-wip-6378.tar.gz
mon: OSDMonitor: do not write full_latest during trimwip-6378
On commit 81983bab we patched OSDMonitor::update_from_paxos() such that we write the latest full map version to 'full_latest' each time the latest full map was built from the incremental versions. This change however clashed with OSDMonitor::encode_trim_extra(), which also wrote to 'full_latest' on each trim, writing instead the version of the *oldest* full map. This duality of behaviors could lead the store to an inconsistent state across the monitors (although there's no sign of it actually imposing any issues besides rebuilding already existing full maps on some monitors). We now stop OSDMonitor::encode_trim_extra() from writing to 'full_latest'. This function will still write out the oldest full map it has in the store, but it will no longer write to full_latest, instead leaving it up to OSDMonitor::update_from_paxos() to figure it out -- and it already does. Fixes: #6378 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
-rw-r--r--src/mon/OSDMonitor.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 351524efa81..c3cb6fedf83 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -120,7 +120,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
* We will possibly have a stashed latest that *we* wrote, and we will
* always be sure to have the oldest full map in the first..last range
* due to encode_trim_extra(), which includes the oldest full map in the trim
- * transaction. Start with whichever is newer.
+ * transaction.
+ *
+ * encode_trim_extra() does not however write the full map's
+ * version to 'full_latest'. This is only done when we are building the
+ * full maps from the incremental versions. But don't panic! We make sure
+ * that the following conditions find whichever full map version is newer.
*/
version_t latest_full = get_version_latest_full();
if (latest_full == 0 && get_first_committed() > 1)
@@ -637,7 +642,6 @@ void OSDMonitor::encode_trim_extra(MonitorDBStore::Transaction *tx, version_t fi
bufferlist bl;
get_version_full(first, bl);
put_version_full(tx, first, bl);
- put_version_latest_full(tx, first);
}
// -------------