kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

feat: Add the ability to checkpoint an existing server, and spawn a read-only server on that view.

Open nathanlo99 opened this issue 1 year ago • 7 comments

It would be nice to be able to spawn a read-only server on a snapshot of a given server.

This PR implements this feature, and introduces the flag --snapshot-dir to manage the snapshot.

nathanlo99 avatar Sep 20 '24 18:09 nathanlo99

--- FAIL: TestBitmap (846.21s)
    --- FAIL: TestBitmap/SETBIT/GETBIT/BITCOUNT/BITPOS_boundary_check_(type_bitmap) (150.90s)
        bitmap_test.go:204: 
            	Error Trace:	/Users/runner/work/kvrocks/kvrocks/tests/gocase/unit/type/bitmap/bitmap_test.go:204
            	Error:      	Received unexpected error:
            	            	read tcp 127.0.0.1:50435->127.0.0.1:50429: i/o timeout
            	Test:       	TestBitmap/SETBIT/GETBIT/BITCOUNT/BITPOS_boundary_check_(type_bitmap)

The above check failure seems to be an unrelated i/o timeout; is there a way to rerun the checks?

nathanlo99 avatar Sep 30 '24 14:09 nathanlo99

--- FAIL: TestBitmap (846.21s)
    --- FAIL: TestBitmap/SETBIT/GETBIT/BITCOUNT/BITPOS_boundary_check_(type_bitmap) (150.90s)
        bitmap_test.go:204: 
            	Error Trace:	/Users/runner/work/kvrocks/kvrocks/tests/gocase/unit/type/bitmap/bitmap_test.go:204
            	Error:      	Received unexpected error:
            	            	read tcp 127.0.0.1:50435->127.0.0.1:50429: i/o timeout
            	Test:       	TestBitmap/SETBIT/GETBIT/BITCOUNT/BITPOS_boundary_check_(type_bitmap)

The above check failure seems to be an unrelated i/o timeout; is there a way to rerun the checks?

Yes, it's a flaky test and not related to this PR.

git-hulk avatar Oct 05 '24 08:10 git-hulk

@PragmaTwice @git-hulk could you take another look at this? It seems the previous opportunity to merge was missed because new changes made it to the unstable branch.

nathanlo-hrt avatar Oct 15 '24 14:10 nathanlo-hrt

Would you mind also add example for how you'd like use this? ( better on doc of cli or doc of project?)

mapleFU avatar Oct 22 '24 03:10 mapleFU

apologies for the linter back and forth: i'm unable to build this locally with the same set-up as the linter uses, so a lot of these issues fall through the cracks

nathanlo99 avatar Nov 06 '24 16:11 nathanlo99

@mapleFU I'm not sure how to edit the docs, but one example workflow is the following.

Start a read-write Kvrocks server writing data to ~/kvrocks-dir, for the purposes of writing important data.

$ kvrocks [...] --dir ~/kvrocks-dir

Say the user realizes some of the important data is incorrect: they'd like to debug their script and run it on a copy of the data, possibly changing it. They'd like to do this without fear of corrupting or changing the original server's copy of the data:

$ mkdir ~/debug-dir
$ kvrocks [...] --dir ~/kvrocks-dir --snapshot-dir ~/debug-dir

nathanlo99 avatar Nov 13 '24 19:11 nathanlo99