Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plumbing logic to invoke shard indexing pressure during write operation. #497

Conversation

getsaurabh02
Copy link
Member

@getsaurabh02 getsaurabh02 commented Apr 5, 2021

Description

This PR addresses 2nd out of the 4 planned Items for Shard Indexing Pressure ((#478). Add plumbing logic to invoke shard indexing pressure during write operation.

Changes to Review : 8ab960a

Currently this PR is inclusive of the 1st change (#496), for build and precommit to succeed. Reviewer's are requested to look only at the last commit changes here, and skip the the file changed in previous commits (#496). Once (#496) is merged, will update the branch to have only the top commit here.

Co-authored-by: Dharmesh Singh sdharms@amazon.com

Issues Resolved

Addresses Item 2 of #478

Check List

  • [+] New functionality includes testing.
    • [+] All tests pass
  • [+] New functionality has been documented.
    • [+] New functionality has javadoc added
  • [+] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
…ration. (#478)

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
@odfe-release-bot
Copy link

✅   DCO Check Passed 8ab960a

@odfe-release-bot
Copy link

✅   Gradle Wrapper Validation success 8ab960a

@getsaurabh02 getsaurabh02 changed the title Shard indexing pressure part 2 Add plumbing logic to invoke shard indexing pressure during write operation. Apr 5, 2021
@odfe-release-bot
Copy link

✅   Gradle Precommit success 8ab960a

Copy link
Collaborator

@Bukhtawar Bukhtawar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some of the files in this PR are directly from the previous PR hence I suggest we serialize merging the PRs in order to avoid duplication in rebasing and reviewing

Comment on lines -127 to +183
return indexingPressure.markReplicaOperationStarted(replicaOperationSize(request), force(request));
if (indexingPressure.isShardIndexingPressureEnabled() == false) {
return indexingPressure.markReplicaOperationStarted(replicaOperationSize(request), force(request));
} else {
return () -> {};
}
}

@Override
protected Releasable checkShardReplicaLimits(ReplicaRequest request) {
if (shardIndexingPressure.isShardIndexingPressureEnabled()) {
return shardIndexingPressure.markReplicaOperationStarted(request.shardId, replicaOperationSize(request), force(request));
} else {
return () -> {};
}
Copy link
Collaborator

@Bukhtawar Bukhtawar Apr 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the abstraction could be simplified. Essentially what we are doing here is putting the knowledge of the back pressure mechanism across the board forcing top layers to know the mechanism when ideally they should be agnostic. As you note here shardIndexingPressure.isShardIndexingPressureEnabled() that both shard indexing pressure and indexing pressure cannot mutually co-exist. I advise we simplify this and abstract this knowledge out in low level components

Also from the comment you noted you intended to keep "ShardIndexingPressure as a sub feature and is contained with IndexingPressure"
I am sorry I don't follow you completely based on this part of the code

Copy link
Member Author

@getsaurabh02 getsaurabh02 Apr 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree there was some scope of simplification here. I have made the required structural changes by introducing a top level construct for IndexingPressure as IndexingPressureService in the latest update #496. This largely allows the orchestration of the indexing pressure invocations from all the places in the TransportAction, thereby allowing the top layers to be agnostic of the low level implementation and feature-settings. I see with this change the amount of plumbing changes have reduced with mostly API changes, and one additional call in case of coordinating node. This is all covered in #496 now.

Note: We can update/close this PR shortly after #496 is merged as plumbing changes are covered in that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants