Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osd: set min_version to newest version in maybe_force_recovery #17752

Merged
merged 2 commits into from Oct 2, 2017

Conversation

Projects
None yet
3 participants
@XinzeChi
Copy link
Member

commented Sep 15, 2017

No description provided.

osd: set min_version to newest version in maybe_force_recovery
Signed-off-by: Xinze Chi <xinze@xsky.com>
@XinzeChi

This comment has been minimized.

Copy link
Member Author

commented Sep 18, 2017

@tchaikov ping

@@ -728,7 +728,7 @@ void PrimaryLogPG::maybe_force_recovery()
// find the oldest missing object
version_t min_version = pg_log.get_log().head.version;
hobject_t soid;
if (!pg_log.get_missing().get_items().empty()) {
if (!pg_log.get_missing().get_rmissing().empty()) {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 18, 2017

Contributor

rmissing != missing in backfill

why?

This comment has been minimized.

Copy link
@XinzeChi

XinzeChi Sep 18, 2017

Author Member

in prep_backfill_object_push func, we know the needed version of all backfilling object is zero

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 18, 2017

Contributor

how is this connected to the conclusion of missing.empty() != rmissing.empty()?

This comment has been minimized.

Copy link
@XinzeChi

XinzeChi Sep 18, 2017

Author Member

because we use rmissing iterator instead of missing iterator, rmissing.empty() looks more correctly

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 22, 2017

Contributor

so, i think it's more of a cleanup? am i right?

This comment has been minimized.

Copy link
@XinzeChi

XinzeChi Sep 25, 2017

Author Member

yes

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 26, 2017

Contributor

could you update the commit message accordingly?

@@ -726,7 +726,7 @@ void PrimaryLogPG::maybe_force_recovery()
return;

// find the oldest missing object
version_t min_version = 0;
version_t min_version = pg_log.get_log().head.version;

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 18, 2017

Contributor

could you elaborate a little bit the rationale of this change in the commit message?

This comment has been minimized.

Copy link
@XinzeChi

XinzeChi Sep 18, 2017

Author Member

if min_version is 0, if (min_version > xxx) always return false

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 26, 2017

Contributor

the question is why pg_log.get_log().head.version is correct, but 0 is not.

This comment has been minimized.

Copy link
@XinzeChi

XinzeChi Sep 26, 2017

Author Member

what we want to get is the minimum of the objects' versions. so we should initialize to as head version and compare it with other version

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 28, 2017

Contributor

oic, could you amend the commit message with the explanation above?

@tchaikov tchaikov requested a review from wonzhq Sep 28, 2017

@tchaikov tchaikov added the needs-qa label Sep 28, 2017

@tchaikov
Copy link
Contributor

left a comment

rmissing != missing in backfill

this commit message is wrong and misleading.

@xiexingguo

This comment has been minimized.

Copy link
Member

commented Sep 28, 2017

instead of resetting min_version at the very beginning (and change these codes significantly), I think you can:

--- a/src/osd/PrimaryLogPG.cc
+++ b/src/osd/PrimaryLogPG.cc
@@ -723,7 +723,8 @@ void PrimaryLogPG::maybe_force_recovery()
     pg_shard_t peer = *it;
     if (peer_missing.count(peer) &&
        !peer_missing[peer].get_items().empty() &&
-       min_version > peer_missing[peer].get_rmissing().begin()->first) {
+        (!min_version ||
+       min_version > peer_missing[peer].get_rmissing().begin()->first)) {
       min_version = peer_missing[peer].get_rmissing().begin()->first;
       soid = peer_missing[peer].get_rmissing().begin()->second;
     }
@tchaikov

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2017

@xiexingguo why make 0 a special case? in the sense of correctness, i think to use the maximum possible max eversion as the initial min_version does make sense.

@xiexingguo

This comment has been minimized.

Copy link
Member

commented Sep 28, 2017

use the maximum possible max eversion as the initial min_version does make sense.

Fine with me, kefu:-)

min_version > peer_missing[peer].get_rmissing().begin()->first) {
min_version = peer_missing[peer].get_rmissing().begin()->first;
soid = peer_missing[peer].get_rmissing().begin()->second;
!peer_missing[peer].get_items().empty()) {

This comment has been minimized.

Copy link
@tchaikov

tchaikov Sep 28, 2017

Contributor

might want to drop this change or split it into another separate "refactor only" commit.

osd: using get_rmissing instread of missing as the judgement
the below code using peer_missing iterator

Signed-off-by: Xinze Chi <xinze@xsky.com>

@XinzeChi XinzeChi force-pushed the XinzeChi:wip-force-recovery branch from e29e672 to 96a3cb6 Sep 28, 2017

@tchaikov tchaikov merged commit 0024679 into ceph:master Oct 2, 2017

5 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.