Repository navigation
Move OM request handler fault injection into a test decorator - #11851
Open
rajeshkumarchandolu wants to merge 1 commit into
Open
rajeshkumarchandolu wants to merge 1 commit into
rajeshkumarchandolu wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Move OM request handler fault injection into a test decorator
Why
This is a preparatory change for OM tracing . The tracing work will create the OM
RequestHandlerused byOzoneManagerStateMachineandOzoneManagerProtocolServerSideTranslatorPBas a tracing proxy, usingTracingUtil.createProxy(new OzoneManagerRequestHandler(...), RequestHandler.class, ...). Read and write handling then gets spans such asOzoneManagerRequestHandler.handleWriteRequest.A proxy implements only the
RequestHandlerinterface. TodayOzoneManagerStateMachine#getHandler()casts its handler toOzoneManagerRequestHandler, so that a test can reach a fault-injection hook that exists only on that class. That cast would fail once the handler is a proxy. This PR removes the dependency on the concrete handler class. It doesn't add any tracing itself.What
OzoneManagerRequestHandlercarried a test-onlyFaultInjector:@VisibleForTestingsetInjector/getInjectormethods, and a privateinjectPause();injectPause()ran at the start of everyhandleWriteRequestImplcall in production.Its only user is
OzoneRpcClientTests#testParallelDeleteBucketAndCreateKey, which pauses the write path to reproduce a race between bucket delete and key create.This PR:
FaultInjectedOzoneManagerRequestHandlerundersrc/test. It is aRequestHandlerdecorator that delegates every call and pauses on itsFaultInjectorbeforehandleWriteRequestImpl.injectPause()fromOzoneManagerRequestHandler, so production code no longer has a test hook in the write path.OzoneManagerStateMachine#setHandlernow takes aRequestHandler, andgetHandler()returns theRequestHandlerwithout a cast.testParallelDeleteBucketAndCreateKeywraps the current handler in the decorator, and puts the original handler back once the paused requests have run.Production behaviour is unchanged, except that the write path no longer checks for a test injector.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-XXXX
How was this patch tested?
TestOzoneRpcClient#testParallelDeleteBucketAndCreateKeypasses with the decorator. The test is marked@Unhealthy("HDDS-10886")and skipped in CI, so it was run locally with-Dexcluded-test-groups=benchmark.TestOzoneManagerStateMachine(64 tests) andTestOzoneManagerRequestHandler(27 tests).ozone-managerandozone-integration-test.##Build:
https://github.com/rajeshkumarchandolu/ozone/actions/runs/40860345412