Bug #2828
closed
osd: assign_bid was allowed to mutate and return data
Added by Sage Weil almost 12 years ago.
Updated over 10 years ago.
Description
The osd shouldn't have allowed this. Figure out why, and then see if there is a graceful way to fix it without breaking old rbd clients. :)
this block in ReplicatedPG.cc should also blow away the outdata on the osd_ops:
// Write operations aren't allowed to return a data payload because
// we can't do so reliably. If the client has to resend the request
// and it has already been applied, we will return 0 with no
// payload. Non-deterministic behavior is no good. However, it is
// possible to construct an operation that does a read, does a guard
// check (e.g., CMPXATTR), and then a write. Then we either succeed
// with the write, or return a CMPXATTR and the read value.
if (ctx->op_t.empty() && !ctx->modify) {
// read.
ctx->reply->claim_op_out_data(ctx->ops);
ctx->reply->get_header().data_off = ctx->data_off;
} else {
// write. normalize the result code.
if (result > 0)
result = 0;
}
...except that rbd.assign_bid used to rely on that behavior. That is only used by 'rbd create ...' and not by clients themselves, so we can probably fix this safely.
Reading the code, i'm not sure how it is that it actually worked, however.
- Priority changed from High to Normal
- Status changed from New to Resolved
Also available in: Atom
PDF