21066a09 deletes buffers in the flush callback when immediate_commit is
on, because no SYNC ever removes them then. Since 2e223f03 a flush op
carries its flush_id, so continue_rw() marks its buffers as written,
with flush_id 0, before the callback runs, and delete_flush() finds
nothing. The buffers then stay forever: memory grows with every range
written, and reads are answered from them with version 0, so a CAS
write retried after -EINTR never sees the real version. Skip
mark_flush_written() for immediate_commit ops, as handle_op_part()
already does for mark_flush_written_to().
Also run test_cas with IMMEDIATE_COMMIT=1. It fails without the
previous commit ("CAS write data lost") and without this one ("read
returned version 0").
execute_cas() runs a SYNC before a CAS write over dirty write-back data
only when the pool's immediate_commit is not "all". But the write-back
cache also holds writes for immediate_commit=all pools, so there the CAS
write went to the OSD first, succeeded against the old version, and the
older cached write overwrote it at the next flush. Check enable_writeback
here like the other write-back checks in cluster_client.cpp do.