https://slatedb.io logo
Expose background panics through `db.pan...
# general
c
All, would love to have some eyes/feedback on this: https://github.com/slatedb/slatedb/pull/965 cc @Pierre
cc @almog
I'm particularly interested in the philosophical question: whether we need
db.panics()
at all, or whether we should just have a
db.bg_task_results()
that returns `slatedb::Error`'s for each finished BG task (rather than
Box<dyn Any + Send>
panic payloads as we have now).
a
I guess the main motivation here is to detect that a GC/Compaction bg task is no longer working?
sounds to me like it should be a 0/1 metric, that way I can alert on it and go check whats going on in the logs. at least that's how I'd like to handle it rather than doing that in code (via polling
panics()
or something like that)
or a metric like "time since last success compaction" or "time since last success GC"
c
Yea that makes sense. Do you think it's worthwhile exposing panics (or results) at all for failed bg tasks?
Or just log and move on
a
I'm trying to think about it from the user situation, what can they do about it?
c
Right now, we disable the whole DB on a bg panic, so there's not much to do except shutdown (fence) or restart
yup exactly
With RocksDB, you can opt to ignore failures
e.g. continue without a compactor or without gc
(in a degraded/limp mode)
Both Rohan and I kinda felt like that was overkill vs simply recreating the DB
a
I think big production workloads are going to run separte compator/gc from the main serving process, in which case you'd definitely want to restart them if they fail, and small deployments don't have a big overhead from recreating the DB
I'm all for "log and big panic"
c
big panic?
a
😆 that's how I read what you said, but now I realize it was just "bg panic". i meant "we disable the whole DB on a bg panic"
c
ah gotcha
K, that should greatly simplify things
I'm interested in @Pierre 's thoughts as well
BG panics should not really happen... so if they do.. it's a bad sign
(the tasks shouldn't stop at all)
Only two paths are: 1) a fence, or 2) a panic
p
Why is that? It’s not going to make slatedb scale much more
Yes I agree with that
That’s pretty sound IHMO, the user doesn’t care much about the implementation details
a
it makes for more predictibility in the resource utilization - what I've seen from other dbs is either you reserve a thread(s) for compaction that are frequently idle or you deal with degraded query performance when a compaction kicks in
I think for Slate it's even worse, in that if a compaction runs you might run up your entire bandwidth to/from S3
p
This is pretty easy to scale though
(Usually)
a
the point isn't so much scalability but rather predictibility for capacity planning
if you have to provision for peak read/write + GC + compaction all ongoing you'll probably end up overprovisioning
c
@almog I think this one is ready for 👀 when you have some time: https://github.com/slatedb/slatedb/pull/965