SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

Add integration test for commitlog compression

Open coolreader18 opened this issue 9 months ago • 3 comments

Description of Changes

Followup to #2504. Not sure why I didn't have this as part of that, I think I thought it would take a while to write this.

Expected complexity level and risk

n/a

Testing

  • [x] yes

coolreader18 avatar Apr 01 '25 17:04 coolreader18

I do think we should add a higher-level integration test here. At the very least we should have a test that checks the segments since the last snapshot and makes sure they are not compressed. In the absence of a test like this, I would argue that we need a benchmark for replaying from the latest snapshot, since we care about the performance here.

joshua-spacetime avatar Apr 01 '25 18:04 joshua-spacetime

Do you have any suggestions for how to go about that? RelationalDb doesn't really expose that kind of low level stuff.

coolreader18 avatar Apr 01 '25 19:04 coolreader18

Do you have any suggestions

Maybe just use the datastore directly, like the cutlery does?

kim avatar Apr 01 '25 20:04 kim

I do think we should add a higher-level integration test here. At the very least we should have a test that checks the segments since the last snapshot and makes sure they are not compressed. In the absence of a test like this, I would argue that we need a benchmark for replaying from the latest snapshot, since we care about the performance here.

I've been trying, and I really can't figure out a good way to write this test without just exposing a ton of internals from RelationalDb or the datastore, like literally adding a getter for a RwLockWriteGuard<'_, repo::Fs>. I do think that the benchmark makes the most sense, since that's really what this is a proxy for.

coolreader18 avatar Apr 08 '25 17:04 coolreader18