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(core): disable query cancellation and timeout in WAL apply job #4176

Merged
merged 6 commits into from Jan 31, 2024

Conversation

bziobrowski
Copy link
Contributor

@bziobrowski bziobrowski commented Jan 30, 2024

PR:

  • disables timeout being applied to update statements executed by WAL job via page frames
  • returns error when query to canel is being executed in WAL job.
  • adds is_wal boolean column to result of query_activity() function

@ideoma
Copy link
Collaborator

ideoma commented Jan 31, 2024

Fixes #4160

@jerrinot jerrinot self-requested a review January 31, 2024 11:38
jerrinot
jerrinot previously approved these changes Jan 31, 2024
Copy link
Collaborator

@ideoma ideoma left a comment

Choose a reason for hiding this comment

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

When I run IODispatcherTest.testUpdateCommandRunningInWALCantBeCancelled

I see in the logs

2024-01-31T13:54:29.528032Z E i.q.g.UpdateOperatorImpl could not update
io.questdb.cairo.CairoException: [666] cancelling WAL application!
	at io.questdb.cairo.CairoException.instance(CairoException.java:310)
	at io.questdb.cairo.CairoException.critical(CairoException.java:69)
	at io.questdb.test.cutlass.http.IODispatcherTest$DelayedWALListener.onRegister(IODispatcherTest.java:9364)
	at io.questdb.griffin.QueryRegistry.register(QueryRegistry.java:150)
	at io.questdb.griffin.UpdateOperatorImpl.executeUpdate(UpdateOperatorImpl.java:88)
	at io.questdb.griffin.engine.ops.UpdateOperation.apply(UpdateOperation.java:74)
	at io.questdb.cairo.TableWriter.apply(TableWriter.java:691)
	at io.questdb.cairo.wal.OperationExecutor.executeUpdate(OperationExecutor.java:98)
	at io.questdb.cairo.wal.ApplyWal2TableJob.processWalSql(ApplyWal2TableJob.java:449)
	at io.questdb.cairo.wal.ApplyWal2TableJob.processWalCommit(ApplyWal2TableJob.java:420)
	at io.questdb.cairo.wal.ApplyWal2TableJob.applyOutstandingWalTransactions(ApplyWal2TableJob.java:323)
	at io.questdb.cairo.wal.ApplyWal2TableJob.applyWal(ApplyWal2TableJob.java:506)
	at io.questdb.cairo.wal.ApplyWal2TableJob.doRun(ApplyWal2TableJob.java:561)
	at io.questdb.mp.AbstractQueueConsumerJob.run(AbstractQueueConsumerJob.java:44)
	at io.questdb.mp.Job.run(Job.java:57)
	at io.questdb.mp.Job.drain(Job.java:35)
	at io.questdb.test.cutlass.http.IODispatcherTest.lambda$testUpdateCommandRunningInWALCantBeCancelled$86(IODispatcherTest.java:7788)
	at java.lang.Thread.run(Thread.java:840)

This looks like the test still cancels the update Query for WAL table

@ideoma
Copy link
Collaborator

ideoma commented Jan 31, 2024

[PR Coverage check]

😍 pass : 19 / 20 (95.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/engine/functions/activity/QueryActivityFunctionFactory.java 4 5 80.00%
🔵 io/questdb/cairo/sql/async/PageFrameReduceJob.java 3 3 100.00%
🔵 io/questdb/griffin/SqlCompilerImpl.java 6 6 100.00%
🔵 io/questdb/griffin/QueryRegistry.java 6 6 100.00%

@ideoma ideoma merged commit 5ad8570 into master Jan 31, 2024
21 checks passed
@ideoma ideoma deleted the bz_disable_cancellation_in_wal_job branch January 31, 2024 17:26
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.

None yet

3 participants