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

mon/OSDMonitor: remove trivial PGMap dependency for 'osd primary-temp' command #13616

Merged
merged 1 commit into from Feb 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/mon/OSDMonitor.cc
Expand Up @@ -6813,8 +6813,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
err = -EINVAL;
goto reply;
}
PGMap& pg_map = mon->pgmon()->pg_map;
if (!pg_map.pg_stat.count(pgid)) {
if (!osdmap.pg_exists(pgid)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These function differently — pg_exists just check's whether it's logically present based on pool and pg_num, but pg_stat looks at whether it's been included in a pgstat message.
I presume that's okay and won't bust something if it's run while the PG is being created?

ss << "pg " << pgid << " does not exist";
err = -ENOENT;
goto reply;
Expand Down