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
Conversation
Signed-off-by: Xinze Chi <xinze@xsky.com>
@tchaikov ping |
src/osd/PrimaryLogPG.cc
Outdated
@@ -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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rmissing != missing in backfill
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in prep_backfill_object_push func, we know the needed version of all backfilling object is zero
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this connected to the conclusion of missing.empty() != rmissing.empty()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we use rmissing iterator instead of missing iterator, rmissing.empty() looks more correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, i think it's more of a cleanup? am i right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you elaborate a little bit the rationale of this change in the commit message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if min_version is 0, if (min_version > xxx) always return false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the question is why pg_log.get_log().head.version
is correct, but 0
is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oic, could you amend the commit message with the explanation above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rmissing != missing in backfill
this commit message is wrong and misleading.
--- 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;
} |
@xiexingguo why make |
Fine with me, kefu:-) |
src/osd/PrimaryLogPG.cc
Outdated
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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to drop this change or split it into another separate "refactor only" commit.
the below code using peer_missing iterator Signed-off-by: Xinze Chi <xinze@xsky.com>
e29e672
to
96a3cb6
Compare
No description provided.