]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore/bluefs: Fix sync compaction
authorAdam Kupczyk <akupczyk@redhat.com>
Thu, 3 Mar 2022 14:39:00 +0000 (15:39 +0100)
committerGabriel BenHanokh <benhanokh@gmail.com>
Mon, 7 Mar 2022 15:42:40 +0000 (17:42 +0200)
Fixes problem with sync compaction (_rewrite_log_and_layout_sync).
There was a problem with not updating log_seq after compacting log.

It cause to stop _replay log right after first transaction.

... 20 bluefs _replay 0x0:  op_dir_create sharding
... 20 bluefs _replay 0x0:  op_dir_link  sharding/def to 21
... 20 bluefs _replay 0x0:  op_jump_seq 1025
... 10 bluefs _read h 0x555557c46400 0x1000~1000 from file(ino 1 size 0x1000 mtime 0.000000 allocated 410000 alloc_commit 410000 extents [1:0x1540000~410000])
... 20 bluefs _read left 0xff000 len 0x1000
... 20 bluefs _read got 4096
... 10 bluefs _replay 0x1000: stop: seq 1025 != expected 1026

This is a product of bluefs fine grain locks refactor.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit 2f8e37064ca079c960929d7bb91e84fbf7f5cd47)

Conflicts:
src/test/objectstore/test_bluefs.cc

src/os/bluestore/BlueFS.cc

index 0b9bb0bba8e9842eec0cc9f7bb0944220cc27a01..baae7c5ab2b601eca1dd36f86500d643d7ab7096 100644 (file)
@@ -2507,6 +2507,9 @@ void BlueFS::_rewrite_log_and_layout_sync_LNF_LD(bool allocate_with_fallback,
   }
 #endif
   _flush_bdev();
+  ++log.seq_live;
+  dirty.seq_live = log.seq_live;
+  log.t.seq = log.seq_live;
 
   super.memorized_layout = layout;
   super.log_fnode = log_file->fnode;