Skip to content

fix(sql): breaking change 💥 - inconsistent data in chained period materialized views#6463

Merged
bluestreak01 merged 5 commits intomasterfrom
puzpuzpuz_flaky_period_mv_test
Nov 27, 2025
Merged

fix(sql): breaking change 💥 - inconsistent data in chained period materialized views#6463
bluestreak01 merged 5 commits intomasterfrom
puzpuzpuz_flaky_period_mv_test

Conversation

@puzpuzpuz
Copy link
Copy Markdown
Contributor

@puzpuzpuz puzpuzpuz commented Nov 27, 2025

Fixes inconsistent materialized view data that may be observed on chained views with period refresh. In such scenarios the dependent view may end up with rows that are no longer present in its base view.

Also includes a breaking change. Namely, MANUAL PERIOD views are no longer automatically refreshed when a period ends. Just like with any other MANUAL view the only way to refresh a MANUAL PERIOD view now is via REFRESH MATERIALIZED VIEW SQL.

Finally, improves MatViewFuzzTest:

  • Improves fake clock limit calculation, so that threads do more jumps
  • Adds randomized sample by interval to mat view query

@puzpuzpuz puzpuzpuz self-assigned this Nov 27, 2025
@puzpuzpuz puzpuzpuz added DO NOT MERGE These changes should not be merged to main branch Schrödinger's bug labels Nov 27, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 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 puzpuzpuz_flaky_period_mv_test

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@puzpuzpuz puzpuzpuz changed the title test(sql): flaky MatViewFuzzTest.testSingleTablePeriodView test(sql): add more variations to MatViewFuzzTest.testSingleTablePeriodView Nov 27, 2025
@puzpuzpuz puzpuzpuz changed the title test(sql): add more variations to MatViewFuzzTest.testSingleTablePeriodView fix(sql): inconsistent state of chained period materialized view Nov 27, 2025
@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution Materialized View and removed DO NOT MERGE These changes should not be merged to main branch labels Nov 27, 2025
@puzpuzpuz puzpuzpuz changed the title fix(sql): inconsistent state of chained period materialized view fix(sql): breaking change 💥 - inconsistent state of chained period materialized view Nov 27, 2025
@puzpuzpuz puzpuzpuz changed the title fix(sql): breaking change 💥 - inconsistent state of chained period materialized view fix(sql): breaking change 💥 - inconsistent data in chained period materialized views Nov 27, 2025
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 6 / 6 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/mv/MatViewTimerJob.java 4 4 100.00%
🔵 io/questdb/cairo/mv/MatViewRefreshJob.java 1 1 100.00%
🔵 io/questdb/cairo/mv/MatViewStateStoreImpl.java 1 1 100.00%

@bluestreak01 bluestreak01 merged commit 744da6d into master Nov 27, 2025
47 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_flaky_period_mv_test branch November 27, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior Materialized View Schrödinger's bug SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants