merlimat opened a new pull request, #25993:
URL: https://github.com/apache/pulsar/pull/25993

   ### Motivation
   
   After a PIP-454 metadata store migration completes, the migration status 
REST endpoint keeps reporting `COPYING` instead of `COMPLETED`. Two issues 
combine to cause this:
   
   1. `MigrationCoordinator.copyPersistentData()` walks the source tree from 
`/`, so it also copies the migration flag node itself 
(`/pulsar/migration-coordinator/migration`) into the target store. At copy time 
the flag value is `phase=COPYING`, so the target store ends up with a 
permanently stale flag.
   2. `MetadataMigrationBase.getStatus()` reads the flag through the broker's 
`DualMetadataStore`, whose reads are phase-routed: once the migration is 
`COMPLETED`, the read goes to the *target* store and returns the stale copied 
flag instead of the authoritative state kept in the source store.
   
   ### Modifications
   
   - `MetadataMigrationBase.getStatus()`: read the migration flag from the 
source store, the same pattern `startMigration()` already uses for its conflict 
pre-check.
   - `MigrationCoordinator.copyPersistentData()`: skip the 
`/pulsar/migration-coordinator` subtree, so migration coordination state is 
never copied into the target store.
   - `MigrationState`: introduce a `COORDINATOR_PATH` constant for the 
coordination subtree root; the flag and participants paths now derive from it.
   - Add `MigrationCoordinatorTest.testStatusReportsCompletedAfterMigration`: 
runs a migration through a `DualMetadataStore` (as the broker does), then 
asserts the source store reports `COMPLETED` and that no coordination state 
leaked into the target store. The test fails without the `MigrationCoordinator` 
fix.


-- 
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]

Reply via email to