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

fix(wal): fix WAL apply lag calculation #3095

Merged
merged 3 commits into from
Mar 27, 2023
Merged

Conversation

ideoma
Copy link
Collaborator

@ideoma ideoma commented Mar 24, 2023

Fixes bug found by CI in one of the WAL Fuzz tests.

java.lang.RuntimeException: java.lang.AssertionError
	at io.questdb.cairo.TableWriter.processWalBlock(TableWriter.java:1498)
	at io.questdb.cairo.TableWriter.processWalData(TableWriter.java:1592)
	at io.questdb.cairo.wal.ApplyWal2TableJob.processWalCommit(ApplyWal2TableJob.java:467)
	at io.questdb.cairo.wal.ApplyWal2TableJob.applyOutstandingWalTransactions(ApplyWal2TableJob.java:392)
	at io.questdb.cairo.wal.ApplyWal2TableJob.applyWAL(ApplyWal2TableJob.java:119)
	at io.questdb.cairo.wal.ApplyWal2TableJob.doRun(ApplyWal2TableJob.java:573)
	at io.questdb.mp.AbstractQueueConsumerJob.run(AbstractQueueConsumerJob.java:41)
	at io.questdb.mp.Job.run(Job.java:57)
	at io.questdb.griffin.wal.WalWriterFuzzTest.runApplyThread(WalWriterFuzzTest.java:566)
	at io.questdb.griffin.wal.WalWriterFuzzTest.lambda$applyManyWalParallel$1(WalWriterFuzzTest.java:360)

The reason for assertion failure is the negative WAL Lag value. This is the result of incorrect WAL calculation formula.

@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior Core Related to storage, data type, etc. labels Mar 27, 2023
@ideoma
Copy link
Collaborator Author

ideoma commented Mar 27, 2023

[PR Coverage check]

😍 pass : 10 / 10 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/TableWriter.java 10 10 100.00%

@ideoma ideoma merged commit a7f5dc4 into master Mar 27, 2023
@ideoma ideoma deleted the fix-wal-lag-calculation branch March 27, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect or unexpected behavior Core Related to storage, data type, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants