https://slatedb.io logo
how can I ensure that a compaction writes a finish...
# general
d
how can I ensure that a compaction writes a finished block? This test doesn’t pass because the writer never persists any blocks during compaction: https://github.com/slatedb/slatedb/pull/676/files#diff-a95e5f78fb2bfa81ab7286346dfce08f90db70e76bcd44f9bb2bfadfddcae657R1121-R1174
c
I think there are some examples in db.rs (or perhaps compactor.rs). The easiest way is to: 1. disable wal 2. set a very small
l0_sst_size_bytes
3. set a very small
l0_max_ssts
(like 1 or 2) 4. write enough bytes to trigger l0 flushes 5. use
MockScheduler
to force a compaction
d
got it, thanks. I'm not sure if that approach is the right one though. I'm concerned that the compaction behavior is changing completely due to how the size is measured
c
hmm
So you want to inspect a specific block from a compacted SST after it's written?
d
that was the original idea. Take the size of the block written, because compression doesn't happen until the block is written
but now the most basic test fails because there is no block written in that case, which makes me think it's the wrong approach
c
Gotcha.. so if you do something like what I described above you can then be able to get the SSTs from the sorted runs in the manifest, and open one of them using an SstIterator (or block iterator)
Yea that seems sus....
d
while I was looking at that, I think I found a very minor bug, easier to reason about: https://github.com/slatedb/slatedb/pull/682
c
Oof, that one is my fault lol, good catch