jojochuang opened a new pull request, #8888: URL: https://github.com/apache/hadoop/pull/8888
### Description of PR [HADOOP-20045](https://issues.apache.org/jira/browse/HADOOP-20045) KMS delegation-token verification can stall behind token creation because the shared secret manager holds its global write lock during synchronous ZooKeeper range allocation and token persistence. Allocate sequences under a dedicated allocator lock, prepare the identifier and password under a short global lock, and persist outside that lock before returning success. Preserve the base storage-hook locking behavior for non-ZooKeeper implementations. Abort interrupted range refills without consuming an unreserved sequence number. Adjust Router creation to avoid speculative cache publication or unconditional publication after persistence, which could restore state after cancellation. Existing watcher, cache-miss, and rebuild paths populate created tokens. This change does not claim to resolve existing distributed-cache ordering races or immediate cross-manager revocation; other write-lock holders remain separate work. Add an opt-in end-to-end HTTP benchmark and comparison runner, with instructions in `dev-support/benchmarks/README.md`. Each case uses one KMS JVM, one standalone ZooKeeper JVM, 32 concurrent requests, sequence batch size 100, and no injected delay. Verification uses token-authenticated metadata requests; issuance uses simple primary authentication. Loaded-class fingerprints, authentication preflight, exact submitted mixes, response validation, and token-node growth check the measured paths. Median total successful requests/s across three runs (5 s warmup, 15 s measurement each): | Verify:create | Original | Fixed | Ratio | | --- | ---: | ---: | ---: | | 100:0 | 30,811 | 30,150 | 0.98x | | 99:1 | 17,672 | 26,885 | 1.52x | | 95:5 | 5,349 | 23,949 | 4.48x | | 90:10 | 3,103 | 23,174 | 7.47x | The Jira includes lock-flow, throughput, and p99 latency charts. All 24 HTTP cases passed with zero HTTP/validation errors. The 100:0 control showed variability. Creation p99 increased at 99:1 and 95:5 under higher achieved load; this closed-loop capacity benchmark does not establish matched-arrival-rate latency improvements or production Kerberos/TLS/quorum throughput. Normal CI has no performance threshold. ### How was this patch tested? - Selected common and Router validation: 43 passing tests, including existing delegation-token tests and new blocked-allocation/persistence, concurrent uniqueness, interrupted-refill, failed-store, key-rotation, and Router cache-fallback cases. - The two blocking regression tests time out against the original implementation and pass with the fix. - All 24 end-to-end KMS HTTP benchmark cases passed artifact, submitted-mix, token-count, and response checks. - Lightweight benchmark scheduler/latency-accounting tests and existing KMS authentication-filter test passed. - `git diff --check` passed. Common Checkstyle reports pre-existing violations outside changed lines; the full style check is not clean. ### For code changes: - [x] PR title starts with the corresponding Jira issue ID. - Object-storage integration tests: not applicable. - No new production dependencies or LICENSE/NOTICE changes. ### AI Tooling Contains content generated by OpenAI Codex. - [x] The PR includes the AI-tool disclosure phrase. - [ ] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html (contributor attestation). -- 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]
