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

feat(wal): optimise WAL lag application in case data in order #3151

Merged
merged 13 commits into from
Apr 4, 2023

Conversation

ideoma
Copy link
Collaborator

@ideoma ideoma commented Apr 3, 2023

When WAL is applied it is copied to the last partition first to speed up the application of smaller transactions. When the WAL is ordered and does not create an out-of-order commit with the existing table data the last partition row count can be extended to make the data visible without waiting for further transactions to be applied.

To do this the format of the designated timestamp column in the last partition WAL LAG area should change from 2 LONGs (timestamp, index pair) to a single LONG (timestamp only). Another part of the change is eagerly extending the last partition row count to when in order WAL is copied into it.

@ideoma ideoma marked this pull request as draft April 4, 2023 08:13
@ideoma ideoma marked this pull request as ready for review April 4, 2023 13:12
@puzpuzpuz puzpuzpuz added the Core Related to storage, data type, etc. label Apr 4, 2023
@puzpuzpuz puzpuzpuz self-requested a review April 4, 2023 15:47
puzpuzpuz
puzpuzpuz previously approved these changes Apr 4, 2023
Co-authored-by: Andrei Pechkurov <37772591+puzpuzpuz@users.noreply.github.com>
@puzpuzpuz puzpuzpuz self-requested a review April 4, 2023 16:05
@ideoma
Copy link
Collaborator Author

ideoma commented Apr 4, 2023

[PR Coverage check]

😍 pass : 104 / 109 (95.41%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/TableWriter.java 103 108 95.37%
🔵 io/questdb/cairo/O3PartitionJob.java 1 1 100.00%

@ideoma ideoma merged commit fb0e64c into master Apr 4, 2023
17 checks passed
@ideoma ideoma deleted the wal-lag-optimise-apply-last-partition branch April 4, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Related to storage, data type, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants