Skip to content

fix: block UPDATE of the partition column on a tiered view (#20)#23

Merged
vyruss merged 1 commit into
mainfrom
fix/issue-20-block-partition-key-update
Jun 19, 2026
Merged

fix: block UPDATE of the partition column on a tiered view (#20)#23
vyruss merged 1 commit into
mainfrom
fix/issue-20-block-partition-key-update

Conversation

@vyruss

@vyruss vyruss commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

An UPDATE that changes the partition column (ts) could move a row across the hot/cold cutoff; the in-place rewrite left it in its old tier where the view's tier predicate then hid it, silently losing the row (#20). Block such updates with a clear error for now; relocating the row across tiers is a separate follow-up.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49d93844-6758-4d9f-80d8-6070ce82ba44

📥 Commits

Reviewing files that changed from the base of the PR and between 88cfdb2 and 111cd8e.

⛔ Files ignored due to path filters (1)
  • extension/coldfront/test/expected/update_partition_key_blocked.out is excluded by !**/*.out
📒 Files selected for processing (5)
  • .gitignore
  • docs/architecture_tiered.md
  • extension/coldfront/Makefile
  • extension/coldfront/src/coldfront.c
  • extension/coldfront/test/sql/update_partition_key_blocked.sql

📝 Walkthrough

Walkthrough

A new guard function cf_reject_partition_col_update() is introduced in coldfront.c and hooked into cf_dispatch_emit(). It scans a query's targetList and raises FEATURE_NOT_SUPPORTED when an UPDATE on a tiered view attempts to assign the partition column, regardless of coldfront.allow_mixed_writes. A full SQL regression test, Makefile entry, and architecture documentation update accompany the change.

Changes

Partition column UPDATE rejection

Layer / File(s) Summary
cf_reject_partition_col_update() implementation and dispatch hook
extension/coldfront/src/coldfront.c
Adds cf_reject_partition_col_update() which iterates the query targetList and raises FEATURE_NOT_SUPPORTED for any non-junk assignment targeting the partition column. Calls this function from cf_dispatch_emit() before tier classification begins.
Regression test, Makefile, docs, and .gitignore
extension/coldfront/test/sql/update_partition_key_blocked.sql, extension/coldfront/Makefile, docs/architecture_tiered.md, .gitignore
Adds a 60-line SQL test validating blocked (hot→cold, cold→hot, constant, per-row, tier-deterministic WHERE) and allowed (non-partition-column) UPDATE cases under both allow_mixed_writes modes. Registers the test in REGRESS, extends architecture docs with the SET-clause restriction and delete+reinsert workflow, and excludes CROSS_TIER_MOVE_DESIGN.md from version control.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: blocking UPDATE operations on the partition column of a tiered view, which directly addresses issue #20.
Description check ✅ Passed The description clearly explains the problem (silent row loss when partition column is updated), the solution (blocking such updates), and references issue #20, all of which align with the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-20-block-partition-key-update

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@vyruss vyruss merged commit 4f5f679 into main Jun 19, 2026
6 checks passed
@vyruss vyruss deleted the fix/issue-20-block-partition-key-update branch June 19, 2026 18:48
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.

1 participant