transate_transaction() handled OP_OMAP_RMKEYRANGE in the same case
block as OP_OMAP_SETHEADER, decoding a single bufferlist and calling
omap_setheader(). But OP_OMAP_RMKEYRANGE encodes first/last as two
strings, so decode_bl() misreads the stream and the wrong op is
applied.
Give OP_OMAP_RMKEYRANGE its own case: decode the two strings and pass
them to the two-string PGTransaction::omap_rmkeyrange() overload, which
encodes them into the string[2] bufferlist internally.
Signed-off-by: Sun Yuechi <sunyuechi@iscas.ac.cn>
}
break;
case ceph::os::Transaction::OP_OMAP_RMKEYRANGE:
+ {
+ std::string first = i.decode_string();
+ std::string last = i.decode_string();
+ t_pg->omap_rmkeyrange(i.get_oid(op->oid).hobj, first, last);
+ }
+ break;
case ceph::os::Transaction::OP_OMAP_SETHEADER:
{
ceph::bufferlist bl;