Actions
Bug #52511
closed[pwl ssd] flush cause io re-oreder to writeback layer
% Done:
0%
Source:
Tags:
Backport:
pacific
Regression:
No
Severity:
3 - minor
Reviewed:
Description
consider this workload:
writeA(0,4K)
writeB(0,512).
ssd can make sure writeA, writeB order in cache file. But when flush to osd, it will firstly read cache data and then flush to osd.
Although it keep order when send read op. But it use aio_read, so we can't keep the order of aio_read.
Context* WriteLog<I>::construct_flush_entry_ctx(
std::shared_ptr<GenericLogEntry> log_entry) {
// snapshot so we behave consistently
bool invalidating = this->m_invalidating;
Context *ctx = this->construct_flush_entry(log_entry, invalidating);
if (invalidating) {
return ctx;
}
if (log_entry->is_write_entry()) {
bufferlist *read_bl_ptr = new bufferlist;
ctx = new LambdaContext(
[this, log_entry, read_bl_ptr, ctx](int r) {
bufferlist captured_entry_bl;
captured_entry_bl.claim_append(*read_bl_ptr);
delete read_bl_ptr;
m_image_ctx.op_work_queue->queue(new LambdaContext(
[this, log_entry, entry_bl=move(captured_entry_bl), ctx](int r) {
auto captured_entry_bl = std::move(entry_bl);
ldout(m_image_ctx.cct, 15) << "flushing:" << log_entry
<< " " << *log_entry << dendl;
log_entry->writeback_bl(this->m_image_writeback, ctx,
std::move(captured_entry_bl));
}), 0);
});
ctx = new LambdaContext(
[this, log_entry, read_bl_ptr, ctx](int r) {
auto write_entry = static_pointer_cast<WriteLogEntry>(log_entry);
write_entry->inc_bl_refs();
aio_read_data_block(std::move(write_entry), read_bl_ptr, ctx);
});
return ctx;
If read_cache_data(writeB) firstly arrived before read_cache_data(writeB). The send later layer order is: writeB, writeA.
This mabye be bug.
https://tracker.ceph.com/issues/49876 is the example.
Actions