]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
osd: add pg-upmap-primary to clean_pg_upmaps
authorLaura Flores <lflores@ibm.com>
Fri, 28 Feb 2025 06:04:42 +0000 (06:04 +0000)
committerLaura Flores <lflores@ibm.com>
Fri, 23 Jan 2026 22:34:40 +0000 (22:34 +0000)
commite37d02a3a591f559710471d4ce3dcef76bb9565f
treed330432644a4ec4c42ca286ea0f5619cbd1d116c
parent847eaa96402bfcec2a4eda5a874457df62822d31
osd: add pg-upmap-primary to clean_pg_upmaps

This commit adds handling of pg_upmap_primary to `clean_pg_upmaps`
so invalid mappings are properly removed. Invalid mappings occur
when pools are deleted, the PG size is decreased, or an OSD is
marked down/out.

Test cases cover cases where:
1. PG num is reduced (all pg_upmap_primary mappings should be canceled)
2. An OSD outside of the up set has been mapped as the primary
3. An OSD is marked "out"
4. A mapping is redundant
5. A pool is deleted

Run the unit test with:
$ ninja unittest_osdmap
$ ./bin/unittest_osdmap --gtest_filter=*CleanPGUpmapPrimaries* --debug_osd=10

Fixes: https://tracker.ceph.com/issues/67265
Signed-off-by: Laura Flores <lflores@ibm.com>
src/mon/OSDMonitor.h
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/test/osd/TestOSDMap.cc
src/tools/osdmaptool.cc