Skip to content

fix(core): avoid server-main error on WAL table rename race - #7046

Merged
bluestreak01 merged 1 commit into
masterfrom
jh_wal_purge_rename_error
Apr 30, 2026
Merged

fix(core): avoid server-main error on WAL table rename race#7046
bluestreak01 merged 1 commit into
masterfrom
jh_wal_purge_rename_error

Conversation

@jerrinot

Copy link
Copy Markdown
Contributor

WalPurgeJob can process a table token snapshot after the table has been renamed and the original name reused. Treat the resulting stale-token exception as a retryable purge race and leave the current registry state for the next purge pass.

Example error:

2026-04-29T19:00:18.754926Z C server-main unhandled error [job=io.questdb.cairo.wal.WalPurgeJob@2b62442c, ex=io.questdb.cairo.sql.TableReferenceOutOfDateException: cached query plan cannot be used because table schema has changed [table=table_name, expectedTableId=4358, actualTableId=4360, expectedMetadataVersion=4360, actualMetadataVersion=-1]

@jerrinot jerrinot added the Bug Incorrect or unexpected behavior label Apr 30, 2026
@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown

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.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e42b6be8-6f27-455d-b0a2-b3855c33e839

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

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jh_wal_purge_rename_error

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.

@jerrinot jerrinot changed the title chore(core): avoid server-main error on WAL table rename race fix(core): avoid server-main error on WAL table rename race Apr 30, 2026
WalPurgeJob can process a table token snapshot after the table has been
renamed and the original name reused. Treat the resulting stale-token
exception as a retryable purge race and leave the current registry state for
the next purge pass.

Example error:
2026-04-29T19:00:18.754926Z C server-main unhandled error [job=io.questdb.cairo.wal.WalPurgeJob@2b62442c, ex=io.questdb.cairo.sql.TableReferenceOutOfDateException: cached query plan cannot be used because table schema has changed [table=table', expectedTableId=4358, actualTableId=4360, expectedMetadataVersion=4360, actualMetadataVersion=-1]
@jerrinot
jerrinot force-pushed the jh_wal_purge_rename_error branch from a5987f2 to 3edb761 Compare April 30, 2026 11:06
@mtopolnik

Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 2 / 4 (50.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/wal/WalPurgeJob.java 2 4 50.00%

@bluestreak01
bluestreak01 merged commit 0772c84 into master Apr 30, 2026
51 checks passed
@bluestreak01
bluestreak01 deleted the jh_wal_purge_rename_error branch April 30, 2026 13:24
nwoolmer added a commit that referenced this pull request May 6, 2026
Brings in 12 upstream commits (b6b3b15..c0c5638). Notable
upstream changes:

* feat(core): compact posting index for SYMBOL columns (#6861) plus
  follow-ups #7051 (seal indexes after WAL fast-lag commit) and #7052
  (refresh covering sidecar mappings on reader reload). Adds DirectBitSet,
  bp_bitpack / FSST native helpers, and PostingIndexBenchmarkSuite.
* fix(sql): preserve outer-join predicates, fix NOT in UNION, isolate
  parser state (#7027).
* fix(sql): BETWEEN inside sub-expression (#7044).
* fix(sql): JIT filter wrong results with UUID bind variables (#7049).
* fix(core): avoid server-main error on WAL table rename race (#7046).
* chore(ilp): fix QWP string-to-numeric parse status classification (#7038).
* Build/CI chores: aux-job moved to Hetzner (#7054), latest IntelliJ for
  formatting (#7040), 'qwp' allowed as PR-title subtype, level switch
  added to review-pr skill (#7055).

Conflict: core/src/main/resources/io/questdb/bin/linux-x86-64/libquestdb.so
is a prebuilt native library; took master's version (same resolution as
the prior 046c874 merge). Other native libs were updated cleanly
without conflict.

Auto-merged: SqlCompilerImpl.java, SqlCodeGenerator.java, SqlParser.java,
SqlKeywords.java, TableColumnMetadata.java, TableWriter.java,
AbstractCairoTest.java. Errand-specific files (MemFdFilesFacade,
HybridCairoConfiguration, ArrowBulkExport, ArrowBulkIngest) untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants