nix-oss opened a new pull request, #1901:
URL: https://github.com/apache/cloudberry/pull/1901

   ### What does this PR do?
   Previously, gpexpand compared tablespace OIDs returned as strings by 
os.listdir() against integer keys from the pg_tablespace query, so the checks 
always evaluated to False. This skipped tablespace template generation and left 
broken symlinks on new segments.
   
   - read_tablespace_file() now casts the OID to int before the lookup
   - generate_tablespace_inputfile() now casts the OID to int before the lookup
   - Added unit tests covering both methods
   
   Fixes #1885
   
   ### Type of Change
   - [x] Bug fix (non-breaking change)
   - [ ] New feature (non-breaking change)
   - [ ] Breaking change (fix or feature with breaking changes)
   - [ ] Documentation update
   
   ### Breaking Changes
   <!-- Remove if not applicable. If yes, explain impact and migration path -->
   
   ### Test Plan
   <!-- How did you test these changes? -->
   - [x] Unit tests added/updated
   - [ ] Integration tests added/updated
   - [ ] Passed `make installcheck`
   - [ ] Passed `make -C src/test installcheck-cbdb-parallel`
   
   Added two unit tests in `gpMgmt/bin/gppylib/test/unit/test_unit_gpexpand.py` 
(`GpExpandTablespaceTests`) covering `read_tablespace_file()` and 
`generate_tablespace_inputfile()`
   
   ### Impact
   <!-- Remove sections that don't apply -->
   **Performance:**
   None.
   
   **User-facing changes:**
   
   `gpexpand` now correctly detects user-created tablespaces when re-run with 
`-i` against an existing tablespace input file, so new segments get valid 
tablespace symlinks instead of broken ones.
   
   **Dependencies:**
   None.
   
   ### Checklist
   - [x] Followed [contribution 
guide](https://cloudberry.apache.org/contribute/code)
   - [ ] Added/updated documentation
   - [ ] Reviewed code for security implications
   - [ ] This PR contains AI-assisted code generation
   - [ ] Requested review from [cloudberry 
committers](https://github.com/orgs/apache/teams/cloudberry-committers)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to