Skip to content

Commit cffd10f

Browse files
committed
osd: Do not sent PDWs if read count > k
The main point of PDW (as currently implemented) is to reduce the amount of reading performed by the primary when preparing for a read-modify-write (RMW). It was making the assumption that if any recovery was required by a conventional RMW, then a PDW is always better. This was an incorrect assumption as a conventional RMW performs at most K reads for any plugin which supports PDW. As such, we tweak this logic to perform a conventional RMW if the PDW is going to read k or more shards. This should improve performance in some minor areas. Signed-off-by: Alex Ainscow <[email protected]>
1 parent 2ab45a2 commit cffd10f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/osd/ECTransaction.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ ECTransaction::WritePlanObj::WritePlanObj(
213213

214214
if (pdw_write_mode != 0) {
215215
do_parity_delta_write = (pdw_write_mode == 2);
216+
} else if (pdw_read_shards.size() >= sinfo.get_k()) {
217+
// Even if recovery required for a convention RMW, PDW is not more
218+
// efficient.
219+
do_parity_delta_write = false;
216220
} else if (!shard_id_set::difference(pdw_read_shards, readable_shards).empty()) {
217221
// Some kind of reconstruct would be needed for PDW, so don't bother.
218222
do_parity_delta_write = false;

0 commit comments

Comments
 (0)