[Refactor♻️] Rename MetadataIoReceipt::wait_until_outcome to wait_for_persistence_status_until
Target Code
Rename the public method on rocketmq_runtime::MetadataIoReceipt. A downstream caller should be able to migrate with this one-line edit.
-let status = receipt.wait_until_outcome(deadline).await?;
+let status = receipt.wait_for_persistence_status_until(deadline).await?;
Problems
The existing Rustdoc says the method waits for the snapshot to become durable. It actually waits for the actor to deliver a terminal MetadataWritePersistenceStatus by an absolute deadline. Ok(status) can report a durable generation, a failure before replacement, or unconfirmed durability. A newer coalesced generation can satisfy an earlier receipt. Expiry ends the caller's wait while the admitted write can still finish. Current implementation
Proposed Changes
Implementation and callers
- [ ] In
rocketmq-runtime/src/metadata_io.rs, rename the method. Keep the consumingself, thedeadline: MetadataDeadlineparameter, and theRuntimeResult<MetadataWritePersistenceStatus>return type. Update its Rustdoc summary and# Errorssection. An elapsed deadline yields theWaitForDurableMetadatatimeout error. A stopped worker or closed coordinator channel yields aMetadataWorkerStoppederror. Update the intra-doc link on the privateReceiptConclusionenum as well. Private Rustdoc link - [ ] In the same file, update the delegate call inside
MetadataIoReceipt::wait_until. This wrapper still returns the durable generation or propagates an error. Generation wrapper - [ ] Update the accepted-receipt branches of
MetadataIoActor::submit_commitandMetadataIoActor::submit_next_commit. Both wrap the returned status inMetadataWriteCompletionStatus::Completed. submit_commit and submit_next_commit
Two direct test calls in rocketmq-runtime/tests/metadata_io_actor.rs
- [ ] In
retirement_keeps_unknown_outcome_fenced_and_old_actor_cannot_rebind_a_retired_history, change the call onreceipt. Preserve the assertions on the unconfirmed status and the reconciliation fence. Retirement assertion - [ ] In
unconfirmed_commit_fences_a_target_that_still_has_queued_work, change the call onfirst. The latersecond.wait_until(deadline)checks the confirmed generation and should keep calling that wrapper. Queued-write assertions
Release documentation
- [ ] Add the before/after call above to the Metadata write persistence status section. Explain the source-breaking rename for downstream Rust callers. rocketmq-doc/en/release/1.0/api-migration.md
- [ ] Add an Unreleased / Changed entry naming the old and new methods. CHANGELOG.md
Related issues #13090 and #13091 cover the inner status variant and the observation field respectively. This task can land independently.
Verify from the repository root
cargo fmt -p rocketmq-runtime -- --check
cargo test --locked -p rocketmq-runtime --test metadata_io_actor
cargo rustdoc --locked -p rocketmq-runtime --lib -- --document-private-items -D rustdoc::broken_intra_doc_links
The integration tests exercise both direct calls, both submission wrappers, coalesced generations, and a deadline expiring while the accepted write continues. The Rustdoc command checks the renamed link on private items. A final search with rg -n -w -g '*.rs' 'wait_until_outcome' . should find no Rust references to the old method. The migration guide and changelog should mention both spellings.
I'll take this one. I'll rename the receipt method, update its callers and migration notes, and verify the actor tests and private Rustdoc links.