bobhan1 opened a new pull request, #71421: URL: https://github.com/apache/doris/pull/71421
### Background Cloud merge-on-write tables use a table-level lock in FoundationDB to coordinate delete bitmap updates. V1 stores holders in the table lock. V2 stores compaction and schema change holders in per-job keys. Meta Service currently uses an instance allowlist to select the protocol for each request. ### What problem does this PR solve? Issue Number: None Related PR: #70760 (per-table creation policy) PR Type: Enhancement Problem Summary: A protocol change can cause requests against an existing lock to look for its holder in a different key. Record the protocol on the table lock and use it until the holders drain. This is the compatibility release for enabling V2 by default in a later release. The default for new locks continues to follow the existing allowlist. ### Details - **Change map:** Production and build code adds 628 and removes 1,187 lines. Tests add 363 and remove 709 lines. A shared implementation replaces the duplicate acquisition and release paths. The tests replace mixed-protocol expectations with drain and takeover coverage. - **Before and after:** GET resolves the protocol inside the grant transaction. A busy table continues to accept requests under its current protocol. When a table drains, the next grant can select a different protocol in the same transaction. UPDATE, job completion and cleanup validate the recorded protocol and holder. Repeated release is idempotent. A job commit whose lock is gone reports `LOCK_EXPIRED`. - **Configs and defaults:** There are no new configuration settings. Keep the existing `delete_bitmap_lock_v2_white_list` value fixed during the rollout. It selects the compatibility release's default and interprets legacy locks without a stored protocol. - **Impact on existing users:** Existing load and job RPCs carry the same identities. Existing V2 instances can continue to use V2. An instance can keep issuing locks during rollout. - **Behavior change:** The table drains before a protocol switch. A missing holder rejects bitmap writes or publication and repeated removal has no effect. - **Migration:** Deploy this version to every Meta Service and standalone Recycler before a later release defaults all instances to V2. During that rollout, each table switches at an idle acquisition. ### Testing - Built production Cloud with ASAN, `MAKE_TEST=OFF` and injection points disabled. - Ran 74 distinct focused Cloud cases successfully, including 18 against isolated FoundationDB 7.3.69. The real FDB tests exercise both commit orders for a V2 join racing with a protocol switch and verify that a split bitmap write stops when its lock is reacquired under another protocol. Two MemTxnKv variants skip because they require real range conflicts. - Verified optional protobuf tag 4 and absent, V1 and V2 round trips against master and branches 4.2, 4.1, 4.0 and 3.1. ### Notes for Reviewers Same-type V2 jobs still read the table lock and write their own holder key. The protocol switch adds a range probe only when the target differs from a V2 job header. Lock identity continues to use the existing lock ID and initiator. ### Release note Cloud MoW locks now record their protocol until the table drains. This prepares existing tables for switching to the V2 default in a later release. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: Yes (document the two-release rollout in the Cloud upgrade guide) - Pre-submission status: Partially verified: the transaction races were exercised on real FDB, while a mixed-binary cluster rollout has not been run ### AI Disclosure - Tool: Codex (GPT-6) - Generated: Implementation, tests and PR description - Human review: Pending -- 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]
