Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): reduce sequencer txn log file storage record length from 60 to 40 bytes #4322

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

ideoma
Copy link
Collaborator

@ideoma ideoma commented Mar 21, 2024

The new sequencer V2 record can be compacted to 40 bytes instead of 60 without sacrificing too much of usable data range and code complexity.

Proposed layout:

  • Structure Version: 40 bits, range: 0-1T
  • WAL Id: 32 bits, range: 0-4B (unchanged)
  • Segment Txn: 24 bits, range: 0-16M
  • Segment Id: 24 bits, range: 0-16M
  • Commit Timestamp: 48 bits, stored in milliseconds, range: years 1970-10889
  • Min Data Timestamp: 64 bits, microseconds
  • Max Data Timestamp: 48 bits, stored as the difference from Min Data Timestamp, microseconds. Range: 3 years from Min Data Timestamp
  • Commit Row Count: 40 bits, range: 0-1T

@ideoma ideoma marked this pull request as draft March 21, 2024 13:36
@ideoma ideoma marked this pull request as ready for review April 16, 2024 08:27
@ideoma
Copy link
Collaborator Author

ideoma commented Apr 29, 2024

[PR Coverage check]

😍 pass : 52 / 64 (81.25%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/wal/seq/TableSequencerImpl.java 1 4 25.00%
🔵 io/questdb/cairo/wal/WalWriter.java 8 14 57.14%
🔵 io/questdb/cairo/wal/seq/TableTransactionLogV2.java 39 42 92.86%
🔵 io/questdb/cairo/wal/WalUtils.java 1 1 100.00%
🔵 io/questdb/cairo/wal/seq/TableTransactionLogV1.java 3 3 100.00%

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.

1 participant