Fix issue where compact_rev_key was protected from deletion, instead
of the row it points to. Honestly we should have stored the
compact_rev marker in the value instead of the prev_revision
column. (#61)
Test:
Run k3s with kine backend (any SQL backend; doesn't matter): k3s --debug server
Wait for compaction message to appear in log output - something like level=debug msg="COMPACT deleted 0 rows from 3 revisions in 2.484763ms - compacted to 3/1745"
Stop k3s+kine
Run query: SELECT id, name FROM kine WHERE name = "/registry/health";
Run query: UPDATE kine SET prev_revision = 1 WHERE name = 'compact_rev_key'; - use the ID from the previous step instead of 1 if it was different.
Start k3s; wait for compaction message to appear in log output
Run query: SELECT id, name FROM kine WHERE name = "/registry/health"
Confirm that /registry/health entry still present with the same ID
Test:
k3s --debug server
level=debug msg="COMPACT deleted 0 rows from 3 revisions in 2.484763ms - compacted to 3/1745"
SELECT id, name FROM kine WHERE name = "/registry/health";
UPDATE kine SET prev_revision = 1 WHERE name = 'compact_rev_key';
- use the ID from the previous step instead of1
if it was different.SELECT id, name FROM kine WHERE name = "/registry/health"
Signed-off-by: Brad Davidson brad.davidson@rancher.com