Repository navigation
Backport #8872: Quote the tablespace name in REINDEX commands sent to shards (release-13.2) - #8911
Open
ibrahim halatci (ihalatci) wants to merge 1 commit into
Open
ibrahim halatci (ihalatci) wants to merge 1 commit into
ibrahim halatci (ihalatci) wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## release-13.2 #8911 +/- ##
=================================================
- Coverage 88.69% 22.71% -65.98%
=================================================
Files 289 289
Lines 64641 63411 -1230
Branches 8153 7877 -276
=================================================
- Hits 57333 14405 -42928
- Misses 4889 47174 +42285
+ Partials 2419 1832 -587 🚀 New features to boost your workflow:
|
DESCRIPTION: Fixes REINDEX with a tablespace name that needs quoting `REINDEX (TABLESPACE "Test Tablespace") INDEX idx` on a distributed table fails, because the per-shard command is built with the tablespace name unquoted (`AddVacuumParams` in `citus_ruleutils.c`): ``` reindex(TABLESPACE "Test Tablespace") index idx; ERROR: syntax error at or near "Tablespace" CONTEXT: while executing command on localhost:57637 ``` A mixed-case name like `"TS1"` is downcased on the workers instead, so it points at a different tablespace or at one that does not exist. The fix quotes the name with `quote_identifier`, the same way the rest of the statement is deparsed. **Test.** I added a case to `pg14.sql` next to the existing `reindex(TABLESPACE ...)` tests. It renames `test_tablespace` to `"Test Tablespace"` on all nodes, reindexes, and renames it back. - On `main` @ c267b0b, the test fails with the syntax error above. - With the fix, it passes. I ran this on PG 17.11 in Docker with `make check-custom-schedule` (minimal cluster setup + `tablespace` + `pg14`). One local-only change was needed: `pg14` has `citus_move_shard_placement` cases that failed on my host's disk-space check, so I set `citus.desired_percent_disk_available_after_move=0` in `pg_regress_multi.pl`. That change is not part of this PR. `uncrustify` with the citus-style config reports no changes. This PR was prepared with an AI coding agent (Claude) working for the breken-ai account. I reviewed the change and the test output. (cherry picked from commit 76a8377) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d89d1f43-18ea-4405-bd1b-5c3129e391a9
ibrahim halatci (ihalatci)
force-pushed
the
bp-8872-release-13.2
branch
from
October 14, 2026 07:27
651aa73 to
f6e5c24
Compare
ibrahim halatci (ihalatci)
changed the base branch from
release-13.2
to
bp-8873-release-13.2
October 14, 2026 07:35
ibrahim halatci (ihalatci)
added this pull request to stack #8928
October 14, 2026 07:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports #8872 (commit 76a8377) to release-13.2.
Description
Quote the tablespace name in \REINDEX (TABLESPACE ...)\ commands sent to shards using \quote_identifier, preventing syntax errors or unintended lowercasing on workers.
Validation
Tested locally on PostgreSQL 17 with regression test \pg14.