]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/: add pg_log_entry_t::reverting_to for LOST_REVERT
authorSamuel Just <sam.just@inktank.com>
Wed, 31 Oct 2012 22:38:35 +0000 (15:38 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 31 Oct 2012 23:21:44 +0000 (16:21 -0700)
commitda9aed99c70c3a4f9be36654990d5192173077da
treef8d75ec7ac29248f1020b918784c437a6d832c54
parentfd4b839d04525f5ca9069bad82b2f7f7f8ae8689
osd/: add pg_log_entry_t::reverting_to for LOST_REVERT

Previously, we encoded the version to which we were
reverting in the prior_version field.  Now, we explicitely
encode that version in the reverting_to field.

Using prior_version to encode the reverting_to version
could cause us to revert to the wrong version:

primary osd.1 writes foo 7'6(0'0)
primary osd.1 writes foo 9'9(7'6)
primary osd.0 learns the log up to 9'9 but recovers no objects
primary osd.1 dies
primary osd.0 reverts the foo in version 17'11(7'6) to 7'6
primary osd.1 comes back and starts to recover itself

foo is not missing on osd.1, and so the new log entry
17'11(7'6) causes osd.1's missing set to contain an entry
for foo with need=17'11 and have=7'6.  recover_primary uses
this information to conclude that we can locally recover
the LOST_REVERT event from the local copy which it assumes
is 7'6 but in fact is 9'9.

This bug actually manifested as failing an assert in
populate_obc_watchers since the version on disk didn't
match the prior_version of the log event.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/osd_types.cc
src/osd/osd_types.h