Skip to content

fix(core): prevent rare exception from async jobs when table is dropped#6361

Merged
bluestreak01 merged 1 commit intomasterfrom
vi_out_of_date
Nov 7, 2025
Merged

fix(core): prevent rare exception from async jobs when table is dropped#6361
bluestreak01 merged 1 commit intomasterfrom
vi_out_of_date

Conversation

@bluestreak01
Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 commented Nov 7, 2025

Found through concurrent tests:

io.questdb.cairo.sql.TableReferenceOutOfDateException: cached query plan cannot be used because table schema has changed [table=tango', expectedTableId=31, actualTableId=32, expectedMetadataVersion=32, actualMetadataVersion=-1]
	at [email protected]/io.questdb.cairo.sql.TableReferenceOutOfDateException.of(TableReferenceOutOfDateException.java:74)
	at [email protected]/io.questdb.cairo.CairoEngine.verifyTableToken(CairoEngine.java:1588)
	at [email protected]/io.questdb.cairo.CairoEngine.getTableMetadata(CairoEngine.java:912)
	at [email protected]/io.questdb.cairo.CairoEngine.getTableMetadata(CairoEngine.java:895)
	at [email protected]/io.questdb.cairo.wal.CheckWalTransactionsJob.checkNotifyOutstandingTxnInWal(CheckWalTransactionsJob.java:101)
	at [email protected]/io.questdb.cairo.wal.CheckWalTransactionsJob.lambda$new$0(CheckWalTransactionsJob.java:67)
	at [email protected]/io.questdb.cairo.wal.seq.TableSequencerAPI.forAllWalTables(TableSequencerAPI.java:174)
	at [email protected]/io.questdb.cairo.wal.CheckWalTransactionsJob.checkMissingWalTransactions(CheckWalTransactionsJob.java:74)
	at [email protected]/io.questdb.cairo.wal.CheckWalTransactionsJob.runSerially(CheckWalTransactionsJob.java:130)
	at [email protected]/io.questdb.mp.SynchronizedJob.run(SynchronizedJob.java:40)
	at [email protected]/io.questdb.mp.SynchronizedJob.run(SynchronizedJob.java:50)
	at io.questdb.test/io.questdb.test.AbstractTest.drainWalQueue(AbstractTest.java:153)
	at io.questdb.test/io.questdb.test.AbstractTest.drainWalQueue(AbstractTest.java:145)
	at io.questdb.test/io.questdb.test.AbstractCairoTest.drainWalQueue(AbstractCairoTest.java:1573)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.PreparedStatementInvalidationTest.mayDrainWalQueue(PreparedStatementInvalidationTest.java:1447)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.PreparedStatementInvalidationTest.executeStatementWhileConcurrentlyChangingSchema(PreparedStatementInvalidationTest.java:1414)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.PreparedStatementInvalidationTest.lambda$testUpdateWhileConcurrentlyRecreatingTable_preparedStatementReused$69(PreparedStatementInvalidationTest.java:1321)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.BasePGTest.lambda$assertWithPgServer$1(BasePGTest.java:472)
	at io.questdb.test/io.questdb.test.AbstractCairoTest.lambda$assertMemoryLeak$9(AbstractCairoTest.java:1259)
	at io.questdb.test/io.questdb.test.tools.TestUtils.assertMemoryLeak(TestUtils.java:775)
	at io.questdb.test/io.questdb.test.AbstractCairoTest.assertMemoryLeak(AbstractCairoTest.java:1254)
	at io.questdb.test/io.questdb.test.AbstractCairoTest.assertMemoryLeak(AbstractCairoTest.java:1237)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.BasePGTest.assertWithPgServer(BasePGTest.java:462)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.BasePGTest.assertWithPgServer(BasePGTest.java:493)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.BasePGTest.assertWithPgServer(BasePGTest.java:482)
	at io.questdb.test/io.questdb.test.cutlass.pgwire.PreparedStatementInvalidationTest.testUpdateWhileConcurrentlyRecreatingTable_preparedStatementReused(PreparedStatementInvalidationTest.java:1319)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at [email protected]/org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at [email protected]/org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at [email protected]/org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at [email protected]/org.junit.internal.runners.statements.InvokeMe

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 7, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vi_out_of_date

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😞 fail : 0 / 1 (00.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/wal/CheckWalTransactionsJob.java 0 1 00.00%

@bluestreak01 bluestreak01 merged commit a4e7a84 into master Nov 7, 2025
36 of 37 checks passed
@bluestreak01 bluestreak01 deleted the vi_out_of_date branch November 7, 2025 17:01
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.

4 participants