ZTE-EBASE opened a new pull request, #1174:
URL: https://github.com/apache/cloudberry/pull/1174
<!-- Thank you for your contribution to Apache Cloudberry (Incubating)! -->
Fixes #ENUM_HASH_PARTITION_ISSUE
Fixes #PARALLEL_RESTORE_DEADLOCK
### What does this PR do?
1. **Automatic partition handling**: Auto-enables
`--load-via-partition-root` when dumping partitioned tables with hash
partitioning on enum types to prevent partition constraint violations after
dump/reload cycles
2. **Parallel restore safety**: Modifies pg_restore to skip TRUNCATE
operations when partition root loading is detected, eliminating deadlocks and
data loss risks
3. **Dump metadata enhancement**: Adds special comment markers for TABLE
DATA items using partition root loading mode
4. **Documentation update**: Removes obsolete warning about
`--load-via-partition-root` with parallel restore from pg_dump documentation
### Type of Change
- [x] Bug fix (non-breaking change)
- [x] New feature (non-breaking change)
### Breaking Changes
<!-- Remove if not applicable. If yes, explain impact and migration path -->
None
### Test Plan
1. **Enum partition validation**:
- Created tables with hash partitioning on enum types
- Verified consistent row placement after dump/reload cycles
2. **Parallel restore testing**:
```bash
make -C src/test installcheck-cbdb-parallel \
TEST="restore/partition_root"
3.**Compatibility verification**:
Tested backward compatibility with older dump files
Verified graceful degradation for legacy --inserts dumps
### Impact
<!-- Remove sections that don't apply -->
**Performance:**
<!-- Any performance implications? -->
**User-facing changes:**
<!-- Any changes visible to users? -->
No significant change in dump performance for partitioned tables
Parallel restore stability improves overall throughput by eliminating
deadlock points
**Dependencies:**
<!-- New dependencies or version changes? -->
Users no longer need to manually specify --load-via-partition-root for enum
hash partitions
Eliminates data corruption risks during pg_upgrade of partitioned tables
Provides clearer dump file annotation structure
### Checklist
- [ ] Followed [contribution
guide](https://cloudberry.apache.org/contribute/code)
- [ ] Added/updated documentation
- [ ] Reviewed code for security implications
- [ ] Requested review from [cloudberry
committers](https://github.com/orgs/apache/teams/cloudberry-committers)
### Additional Context
<!-- Any other information that would help reviewers? Remove if none -->
Compatibility note:
For existing dumps using --inserts + --load-via-partition-root:
Parallel restore might still trigger deadlocks (legacy file limitation)
Mitigation: Use single-threaded restore or regenerate dump files
### CI Skip Instructions
<!--
To skip CI builds, add the appropriate CI skip identifier to your PR title.
The identifier must:
- Be in square brackets []
- Include the word "ci" and either "skip" or "no"
- Only use for documentation-only changes or when absolutely necessary
-->
---
<!-- Join our community:
- Mailing list:
[[email protected]](https://lists.apache.org/[email protected])
(subscribe: [email protected])
- Discussions: https://github.com/apache/cloudberry/discussions -->
--
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]