[ ] add new unit tests to test corner cases (newer data already present in db, or older data present in db, or a mix of both)
Important notes about deleting many rows at once:
Running a single DELETE FROM xxx WHERE height < yyy is not sufficient. It fails in cockroachdb when there are too many rows to be deleted (docs).
DoD:
height
column lower than the bulk import heightImportant notes about deleting many rows at once: Running a single
DELETE FROM xxx WHERE height < yyy
is not sufficient. It fails in cockroachdb when there are too many rows to be deleted (docs).What must be done is to re-use the "chunked delete" logic contained in the
reset-chain
binary, maybe moving it into a shared go pkg.