diff options
author | Sage Weil <sage@inktank.com> | 2013-07-04 17:09:07 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-04 17:09:07 -0700 |
commit | 1156721f22f5f337241eef3d0276ca74fe6352d1 (patch) | |
tree | 5d077465be72ef2e49e3c72ed642d457ec2c54a7 | |
parent | 40672219a081f0dc2dd536977290ef05cfc9f097 (diff) | |
download | ceph-1156721f22f5f337241eef3d0276ca74fe6352d1.tar.gz |
mon: include any new paxos commits in each sync CHUNK message
We already take note of the paxos version when we begin the sync. As
sync progresses and there are new paxos commits/txns, include those
and update last_committed, so that when sync completes we will have
a full view of everything that happened during sync.
Note that this does not introduce any compatibility change. This change
*only* affects the provider. The key difference is that at the end
of the sync, the provide will set version to the latest version, and
not the version from the start of the sync (as was done previously).
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/mon/Monitor.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 42fc15c5905..e541d4b77a1 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1265,8 +1265,27 @@ void Monitor::sync_send_chunks(SyncEntity sync) assert(sync->synchronizer->has_next_chunk()); MMonSync *msg = new MMonSync(MMonSync::OP_CHUNK); + MonitorDBStore::Transaction tx; + + // include any recent paxos commits + if (sync->version < paxos->get_version()) { + while (sync->version < paxos->get_version()) { // FIXME: limit size? + sync->version++; + dout(10) << " including paxos version " << sync->version << dendl; + bufferlist bl; + store->get(paxos->get_name(), sync->version, bl); + tx.put(paxos->get_name(), sync->version, bl); + } + dout(10) << " included paxos through " << sync->version << dendl; + msg->version = sync->version; + } + + // get next bunch of commits in the remaining space + sync->synchronizer->get_chunk_tx(tx); + + if (!tx.empty()) + tx.encode(msg->chunk_bl); - sync->synchronizer->get_chunk(msg->chunk_bl); msg->last_key = sync->synchronizer->get_last_key(); dout(10) << __func__ << " last key (" << msg->last_key.first << "," |