https://slatedb.io logo
yeah, not sure yet. It completed 11 compaction fo...
# general
v
yeah, not sure yet. It completed 11 compaction for the 1 minute run, this is as expected. And it created 74 manifests.
r
what workload are you running?
v
It was just a test. The code I used is in the bug 121
r
ah gotcha. I think the large number of manifests could just be due to the small l0_sst_file_size_bytes then. At 20K that workload is going to be writing multiple l0 ssts per second. And right now we update the manifest for every l0 sst
c
But shouldn't the l0 SST checks happen as part of the compaciton poll interval?
Ah wait
It happens as part of
manifest_poll_interval
so 10x per-second * 120 seconds...
That would explain it
It's kind of weird that
manifest_poll_interval
defines how frequenlty we can flush to L0 SST... probably should separate that...
So there are two things.. - flush.rs checks every
flush_ms
if we need to freeze and write L0 SSTs - mem_table_flush.rs checks every
manifest_poll_interval
to see if we need to update the manifest with recently written L0's
r
> It happens as part of manifest_poll_interval it's actually explicitly triggered via a channel. So whenever there's a new immutable l0 the memtable flush thread will be notified
so it already works as you've described
c
Hmm
r
or at least - l0 flushing is already decoupled from manifest polling
c
Yes
Ya, that's what I see.
The L0 flushing happens during
flush_ms
v
We should update the default l0 size
c
And then the updated manifest (with the new L0 SSTs) happens as part of
manifest_poll_interval
@Vignesh agreed. And probably manifest_poll_interval, too.
r
manifest_poll_interval
just controls how often the local view of the manifest is refreshed with the one stored in the object store: https://github.com/slatedb/slatedb/blob/1d225f3c7f96416c83188e5572cd1c84d546555a/src/mem_table_flush.rs#L86
c
manifest_poll_interval -> flush_imm_memtables_to_l0 -> write_manifest_safely
That's what I see
Ahhh
the tick is separate
Derp
Sigh. Gotcha.
Yep, yep. K that makes sense then.
So just to restate: 1.
flush_ms
is 100ms 2. Every 100ms, we check if memtable should get flushed >=
l0_max_size_bytes
3. It is always >= max size, so we always flush it. 4. A flush triggers the manifest update immediately..
r
yep, that's what I think is happening
c
K, makes sense. Ya we should probably limit hte manifest updates somehow.. 🤔 Either by increaisng l0 max size or ugh more configs.
I'm inclined to bump up the default l0 byte size a lot
r
fwiw the compaction design proposal already has a config for this:
l0_manifest_commit_interval_ms
. I do think we should bump up the l0 sst size anyway because that's good for reducing compaction overhead and read amplification. I was thinking something like 32 or 64 MB. My only concern with having a high l0 sst size is that wal ssts will build up and drive up recovery times. So we probably want some config like
current_l0_max_wal_ssts
that forces an l0 flush when the number of wal ssts crosses some threshold.
c
So the idea with
l0_manifest_commit_interval_ms
is that, rather than writing L0's to manifest immediately when L0 is written to object storage, we'd write the updated manifest only after
l0_manifest_commit_interval_ms
have passed, right?
From the design: > defines the minimum interval between memtable flush-related manifest updates in milliseconds
> I was thinking something like 32 or 64 MB +1 this SGTM.
> So we probably want some config like current_l0_max_wal_ssts that forces an l0 flush when the number of wal ssts crosses some threshold. I'm torn on this. On the one hand, it seems like we shuold only care about the # of bytes in the WAL, which is already governed by l0_max_size_bytes. OTOTH, we could end up with 1000s of small WAL files which could just take a long time to read through (network latency on GET and such). So yea, we probably do need some count-based limit, huh.
Like, if you had 10ms flush and L0 max size of 1 gig, you could end up with 10000s of WAL fils between L0 flushes... It's almost like we want two bounds on the L0 flush.. a min and max time
Flush it at least once per-10 seconds, but not more frequently than once per-second...
r
> I'm torn on this. On the one hand, it seems like we shuold only care about the # of bytes in the WAL, which is already governed by l0_max_size_bytes. OTOTH, we could end up with 1000s of small WAL files which could just take a long time to read through (network latency on GET and such). Yeah, this is what I was concerned about. Though we should for sure test this scenario out to see how much of a problem it really is. Maybe it's not an issue if we do lots of parallel GETs. LIST perf is also an unknown if there's a ton of WAL files. > It's almost like we want two bounds on the L0 flush.. a min and max time Yeah. I just felt like a wal-sst-count-based threshold will be easier to tune, assuming that is the main driver for the config.
c
Yea that makes sense.
Let's wait 'til it's a problem 🙂
I'm very cognizant of making SlateDB too configurable. RocksDB is a nightmare for that...