From: Aishwarya Mathuria Date: Wed, 13 Nov 2024 13:48:30 +0000 (+0530) Subject: mon/test_mon_osdmap_prune: Use first_pinned instead of first_committed X-Git-Tag: v19.2.3~20^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F63341%2Fhead;p=ceph.git mon/test_mon_osdmap_prune: Use first_pinned instead of first_committed In the test, we assume the trimming of osdmaps is done if osdmap_first_committed is equal to the epoch of the map upto which we had to trim. osdmap_first_committed however returns the value of cached_first_committed which is updated before the Paxos proposal for trim goes through. Normally, this is not a problem as when a refresh() happens, cached_first_committed will be corrected to the value before the trim was proposed if the Paxos proposal failed. But for this test, we encounter a failure in this case as the osdmap_first_committed will not be equal to the osdmap_manifest.first_pinned as the trim never went through. Changing the test to verify that osdmap_manifest.first_pinned has changed to the correct value is a better way to signify that the trim is complete for the purpose of this test. Fixes: https://tracker.ceph.com/issues/47838 Signed-off-by: Aishwarya Mathuria (cherry picked from commit 1e2f3758118b7af6edf8d7153fdb6463fe2e177d) --- diff --git a/qa/workunits/mon/test_mon_osdmap_prune.sh b/qa/workunits/mon/test_mon_osdmap_prune.sh index 9cdd72179577d..b33657c503a32 100755 --- a/qa/workunits/mon/test_mon_osdmap_prune.sh +++ b/qa/workunits/mon/test_mon_osdmap_prune.sh @@ -33,7 +33,9 @@ function wait_for_trim() { for ((i=0; i < ${#delays[*]}; ++i)); do fc=$(ceph report | jq '.osdmap_first_committed') - if [[ $fc -eq $epoch ]]; then + manifest="$(ceph report | jq '.osdmap_manifest')" + first_pinned_map=$(ceph report | jq '.osdmap_manifest.first_pinned') + if [[ $first_pinned_map -eq $epoch ]]; then return 0 fi sleep ${delays[$i]}