Skip to content

mon, osd: add command to remove invalid pg-upmap-primary entries#62190

Merged
yuriw merged 1 commit intoceph:mainfrom
ljflores:wip-tracker-69760
Mar 18, 2025
Merged

mon, osd: add command to remove invalid pg-upmap-primary entries#62190
yuriw merged 1 commit intoceph:mainfrom
ljflores:wip-tracker-69760

Conversation

@ljflores
Copy link
Member

@ljflores ljflores commented Mar 9, 2025

The current rm-pg-upmap-primary command checks that the pgid exists in the pgmap before continuing to remove it. Due to https://tracker.ceph.com/issues/66867, some invalid pg-upmap-primary entires may exist for pools that have been removed. Currently, these mappings are impossible to remove since the pgids no longer exist in the pgmap.

This new command, rm-pg-upmap-primary-all, allows users the ability to remove any and all pg-upmap-primary mappings in the osdmap at once, which includes valid and invalid entries.

This command may also be helpful when upgrading from versions where users are plagued by https://tracker.ceph.com/issues/61948. Users may use an upgraded mon to remove all pg-upmap-primray entries (valid and invalid) so they continue to upgrade to a safe version.

See manual testing for this patch here: https://tracker.ceph.com/issues/67179#note-12

Fixes: https://tracker.ceph.com/issues/67179
Fixes: https://tracker.ceph.com/issues/69760

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

Basically LGTM apart of some nits.
The idea of osd rm-pg-upmap-primary-all looks sane. It satisfies the need an emergency purge in a simple way likely alleviating the demand for --force in the per-PG remove command.

@ljflores ljflores force-pushed the wip-tracker-69760 branch 2 times, most recently from 99c5b4c to ba6cfbc Compare March 10, 2025 21:42
@ljflores ljflores force-pushed the wip-tracker-69760 branch from ba6cfbc to 80c5a66 Compare March 10, 2025 22:17
@ljflores
Copy link
Member Author

jenkins test docs

return true;
}
break;
case OP_RM_PG_UPMAP_PRIMARY_ALL: // no pgid to check
Copy link
Contributor

Choose a reason for hiding this comment

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

very nit ;) - I would put this case as the first one - else it is hard to find it.
I also like to add default: case with an error message or assert just in case someone adds a value in the future and forgets to update all the places

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK, added. This has already gone into teuthology testing, although the change is so trivial that I will confirm locally that the fix works, then IMO it is okay to merge pending QA approval.

Copy link
Member Author

Choose a reason for hiding this comment

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

Confirmed locally.

The current rm-pg-upmap-primary command checks that the pgid exists
in the pgmap before continuing to remove it. Due to https://tracker.ceph.com/issues/66867,
some invalid pg-upmap-primary entires may exist for pools that have been removed.
Currently, these mappings are impossible to remove since the pgids no longer
exist in the pgmap.

This new command, rm-pg-upmap-primary-all, allows users the ability to remove
any and all pg-upmap-primary mappings in the osdmap at once, which includes
valid and invalid entries.

This command may also be helpful when upgrading from versions where users
are plagued by https://tracker.ceph.com/issues/61948. Users may use an upgraded
mon to remove all pg-upmap-primray entries (valid and invalid) so they continue
to upgrade to a safe version.

See manual testing for this patch here: https://tracker.ceph.com/issues/67179#note-12

Fixes: https://tracker.ceph.com/issues/67179
Fixes: https://tracker.ceph.com/issues/69760
Signed-off-by: Laura Flores <lflores@ibm.com>
@ljflores ljflores force-pushed the wip-tracker-69760 branch from 80c5a66 to 6e9e203 Compare March 17, 2025 22:26
@ljflores
Copy link
Member Author

@yuriw yuriw merged commit 8d229a9 into ceph:main Mar 18, 2025
11 checks passed
@ljflores ljflores deleted the wip-tracker-69760 branch March 20, 2025 19:14
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 20, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 20, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 20, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 21, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 24, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
(cherry picked from commit 4dee791)

*Note: PendingReleaseNotes was modified to have the release note under
the v19.2.2 section.
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 24, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
(cherry picked from commit 4dee791)
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 24, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
(cherry picked from commit 4dee791)

*Note: PendingReleaseNotes was modified to have the release note under the v19.2.2 section.
ljflores pushed a commit to ljflores/ceph that referenced this pull request Mar 24, 2025
…ary-{all}" commands

Added a release note for `ceph osd rm-pg-upmap-primary` and documentation to
complement ceph#62190.

Signed-off-by: Laura Flores <lflores@ibm.com>
(cherry picked from commit 4dee791)

*Note: PendingReleaseNotes changed to put the release note under v18.2.5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants