Skip to content

fix(core): fix index error after column add and truncate of non-partioned table#6319

Merged
bluestreak01 merged 3 commits intomasterfrom
fix-truncate-col-top-non-partitioned
Oct 28, 2025
Merged

fix(core): fix index error after column add and truncate of non-partioned table#6319
bluestreak01 merged 3 commits intomasterfrom
fix-truncate-col-top-non-partitioned

Conversation

@ideoma
Copy link
Collaborator

@ideoma ideoma commented Oct 27, 2025

Found by fuzz test O3MaxLagFuzzTest.testFuzzParallel

When an indexed symbol column is added to a non-partitioned table, the indexer column top is not reset on truncate. This causes an error on the next index rebuild.

Specific to non-partitioned tables, which also implies non-WAL.

2025-10-26T15:56:43.4176166Z 2025-10-26T15:56:43.385166Z E i.q.t.TestListener ***** Test Failed ***** io.questdb.test.cairo.fuzz.O3MaxLagFuzzTest.testFuzzParallel[MICRO] duration_ms=867 : 
2025-10-26T15:56:43.4178104Z io.questdb.cairo.CairoError: io.questdb.cairo.CairoException: [14] could not read symbol column during indexing [fd=1028645673145, fileOffset=0, bytesToRead=-48116]
2025-10-26T15:56:43.4178572Z 	at io.questdb.cairo.TableWriter.throwDistressException(TableWriter.java:10103)
2025-10-26T15:56:43.4178951Z 	at io.questdb.cairo.TableWriter.updateIndexesSerially(TableWriter.java:10273)
2025-10-26T15:56:43.4179484Z 	at io.questdb.cairo.TableWriter.updateIndexesSlow(TableWriter.java:10285)
2025-10-26T15:56:43.4179860Z 	at io.questdb.cairo.TableWriter.updateIndexes(TableWriter.java:10176)
2025-10-26T15:56:43.4180434Z 	at io.questdb.cairo.TableWriter.commit00(TableWriter.java:4026)
2025-10-26T15:56:43.4180833Z 	at io.questdb.cairo.TableWriter.commit(TableWriter.java:4008)
2025-10-26T15:56:43.4181193Z 	at io.questdb.cairo.TableWriter.ic(TableWriter.java:2468)
2025-10-26T15:56:43.4181598Z 	at io.questdb.test.cairo.fuzz.O3MaxLagFuzzTest.replayTransactions(O3MaxLagFuzzTest.java:98)
2025-10-26T15:56:43.4182041Z 	at io.questdb.test.cairo.fuzz.O3MaxLagFuzzTest.testFuzz00(O3MaxLagFuzzTest.java:193)
2025-10-26T15:56:43.4182477Z 	at io.questdb.test.cairo.fuzz.O3MaxLagFuzzTest.testFuzz0(O3MaxLagFuzzTest.java:250)
2025-10-26T15:56:43.4182920Z 	at io.questdb.test.cairo.o3.AbstractO3Test.lambda$executeWithPool$5(AbstractO3Test.java:424)
2025-10-26T15:56:43.4183335Z 	at io.questdb.test.tools.TestUtils.execute(TestUtils.java:1491)
2025-10-26T15:56:43.4183746Z 	at io.questdb.test.cairo.o3.AbstractO3Test.lambda$executeWithPool$7(AbstractO3Test.java:422)
2025-10-26T15:56:43.4184169Z 	at io.questdb.test.tools.TestUtils.assertMemoryLeak(TestUtils.java:774)
2025-10-26T15:56:43.4184691Z 	at io.questdb.test.cairo.o3.AbstractO3Test.assertMemoryLeak(AbstractO3Test.java:218)
2025-10-26T15:56:43.4185124Z 	at io.questdb.test.cairo.o3.AbstractO3Test.executeVanilla(AbstractO3Test.java:320)
2025-10-26T15:56:43.4185549Z 	at io.questdb.test.cairo.o3.AbstractO3Test.executeWithPool(AbstractO3Test.java:363)
2025-10-26T15:56:43.4185975Z 	at io.questdb.test.cairo.o3.AbstractO3Test.executeWithPool(AbstractO3Test.java:351)
2025-10-26T15:56:43.4186409Z 	at io.questdb.test.cairo.fuzz.O3MaxLagFuzzTest.testFuzzParallel(O3MaxLagFuzzTest.java:73)

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 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 fix-truncate-col-top-non-partitioned

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
Contributor

[PR Coverage check]

😍 pass : 4 / 4 (100.00%)

file detail

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

@bluestreak01 bluestreak01 merged commit d7fac9f into master Oct 28, 2025
32 of 34 checks passed
@bluestreak01 bluestreak01 deleted the fix-truncate-col-top-non-partitioned branch October 28, 2025 01:35
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.

3 participants