https://slatedb.io logo
I opened a couple PRs. This PR fixes a couple issu...
# general
r
I opened a couple PRs. This PR fixes a couple issues with the compaction stuff that I merged earlier this week: https://github.com/slatedb/slatedb/pull/79 The second PR (https://github.com/slatedb/slatedb/pull/80) adds a copy of TikV's failpoints implementation to our repo. Failpoints looks like a nice way to instrument our code so that we can test error paths without requiring the use of full-blown mocks. I think we should still add mocks to do more targeted unit testing at some point, but failpoints are nice because they let you test failure paths end-to-end, but the injection code can be compiled out of release binaries. The main problem with failpoints, and why I didn't just use it by adding it as a dependency, is that it requires the tests to be run serially because it uses a global static registry of faults. To lift this restriction, I've added a copy of failpoints to our repo, and modified it to use a registry that can be scoped to an individual test case. This PR still has a lot of clippy problems. Since the approach taken here is a bit awkward (copying over a bunch of code) - I'd like to get feedback on the basic approach first and then I can go back and fix the lint problems.
c
Interesting! I’m curious why TiKV doesn’t support this. Wonder if it’s worth pushing the change upstream? Alternatively, wonder if we should put it as a separate repo in the slatedb org? Kinda nervous about vendoring a bunch of code. Lemme look at the PR tomorrow AM.
r
> Interesting! I’m curious why TiKV doesn’t support this It might be worth seeing if they'd be up for it. I think it would be much trickier to get that merged into their implementation as it breaks the api because you have to pass the registry around everywhere. IMO that (passing around the registry) is a good tradeoff it to get around the constraints from using a global registry - but they may not see it that way. My calculus was that its a small enough library that I'm comfortable copying/forking it, and it has enough useful stuff that the r on the i is there. > Alternatively, wonder if we should put it as a separate repo in the slatedb org? Yeah I'd be up for this. I didn't have the steam to work out how to publish a crate for it. Would definitely be cleaner to fork it this way.
c
Fork published to crates might be nice. It’s be a good excuse to set up the slatedb stuff on there. I wouldn’t mind taking this.
r
That'd be awesome. I've found it pretty useful so far. I also took a stab at adding read levels and supporting a write option for not blocking on flush - and it was super useful for those tests to simulate blocking the flush operations: https://github.com/slatedb/slatedb/commit/cefb91f35bee2be0466b8fb3d4f20548e4301b7e
c
Reviewed. LGTM. Left some comments.
That first PR sure cleans things up nicely