Skip to content

Copy database in binary mode#476

Draft
cb1kenobi wants to merge 1 commit intomainfrom
fix/copy-db-binary-mode
Draft

Copy database in binary mode#476
cb1kenobi wants to merge 1 commit intomainfrom
fix/copy-db-binary-mode

Conversation

@cb1kenobi
Copy link
Copy Markdown
Member

I created an database using LMDB storage and then inserted a bunch of rows. Next I ran harper copy-db testdb testdb2 and it errored with:

[main/0] [error]: Reading audit entry error RangeError: Error reading float64: Offset is outside the bounds of the DataView at position 4

When opening the source and target databases, set the encoding to binary so that we completely bypass decoding/encoding and do a true byte copy.

@cb1kenobi cb1kenobi requested a review from a team as a code owner May 5, 2026 22:34
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 5, 2026

Reviewed; no blockers found.

Copy link
Copy Markdown
Member

@kriszyp kriszyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RocksDB record and LMDB records don't really have the same binary format. The RocksDB record starts with the version timestamp (because we decided to not include that natively like lmdb-js does), and then LMDB typically has encoding of id/timestamp reference into the audit log. So I wouldn't think this would work.
I would think the LMDB audit log error probably needs to be addressed regardless.

@cb1kenobi cb1kenobi marked this pull request as draft May 6, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants