From: Alex Ainscow Date: Fri, 28 Nov 2025 14:33:13 +0000 (+0000) Subject: osd: Perform shard look up correctly in partial EC writes X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e2af5a8266f4a639ac8b4f165a3f00fa429097dc;p=ceph.git osd: Perform shard look up correctly in partial EC writes Plugins are permitted to provide a mapping to change the order in which OSDs are used. In practice only LRC does this and it is not currently enabled with optimisations, so this is a theoretical bug. The bug here was that the "first" shard was assumed to be shard_id_t(0). However, this is not true for LRC. Fixes: https://tracker.ceph.com/issues/74016 Signed-off-by: Alex Ainscow --- diff --git a/src/osd/ECTransaction.cc b/src/osd/ECTransaction.cc index b0c49f62b44..ba64e9b388d 100644 --- a/src/osd/ECTransaction.cc +++ b/src/osd/ECTransaction.cc @@ -590,7 +590,7 @@ ECTransaction::Generate::Generate(PGTransaction &t, } else { // All primary shards must always be written, regardless of the write plan. shards_written(sinfo.get_parity_shards()); - shard_written(shard_id_t(0)); + shard_written(sinfo.get_shard(raw_shard_id_t(0))); } written_shards();