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 Indexing Pressure Service which acts as orchestrator for IP #1084

Conversation

getsaurabh02
Copy link
Member

@getsaurabh02 getsaurabh02 commented Aug 12, 2021

This PR is next among the planned PRs planned for Shard Indexing Pressure (#478). It introduces the main Indexing Pressure Service. It aims to provide abstraction and orchestration for indexing pressure interfaces when called from Transport Actions or for Stats.

Signed-off-by: Saurabh Singh sisurab@amazon.com

Description

[Describe what this change achieves]

Issues Resolved

Addresses Item 7 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.

… pressure interfaces.

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Wrapper Validation success 7ca75aa

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 7ca75aa

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Precommit success 7ca75aa

Comment on lines +28 to +34
public Releasable markCoordinatingOperationStarted(ShardId shardId, long bytes, boolean forceExecution) {
if (isShardIndexingPressureEnabled()) {
return shardIndexingPressure.markCoordinatingOperationStarted(shardId, bytes, forceExecution);
} else {
return shardIndexingPressure.markCoordinatingOperationStarted(bytes, forceExecution);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of if-else block it'd be much better if we had the same downstream call which based on settings in their respective classes could have handled these cases

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree thats one way of doing this. Wanted the Service to take care of orchestration logic, as it simplifies addition of new similar constructs in future and even helps deprecation of the older constructs faster. We are also exposing dedicated plumbing logic for callers (such as part of #1113) which routes request for the ease of callers. Let me know if you strongly feel otherwise.

Settings.builder().put(settings), updated, getTestClass().getName());
clusterSettings.applySettings(updated.build());

Releasable releasable = service.markCoordinatingOperationStarted(shardId, 1024, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we assert releasable, maybe on close

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this to verify the releasable behaviour and is being executed once? Those assertions are available part of ShardIndexingPressureTests such as testForceExecutionOnCoordinating. Service tests are primarily to verify the orchestration logic.

@adnapibar adnapibar merged commit 732f0bb into opensearch-project:feature/478_indexBackPressure Aug 19, 2021
adnapibar pushed a commit that referenced this pull request Sep 15, 2021
… pressure interfaces. (#1084)

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
adnapibar pushed a commit that referenced this pull request Sep 15, 2021
… pressure interfaces. (#1084)

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
getsaurabh02 added a commit to getsaurabh02/OpenSearch that referenced this pull request Oct 6, 2021
… pressure interfaces. (opensearch-project#1084)

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
adnapibar added a commit that referenced this pull request Oct 7, 2021
Shard level indexing pressure improves the current Indexing Pressure framework which performs memory accounting at node level and rejects the requests. This takes a step further to have rejections based on the memory accounting at shard level along with other key performance factors like throughput and last successful requests. 

**Key features**
- Granular tracking of indexing tasks performance, at every shard level, for each node role i.e. coordinator, primary and replica.
- Smarter rejections by discarding the requests intended only for problematic index or shard, while still allowing others to continue (fairness in rejection).
- Rejections thresholds governed by combination of configurable parameters (such as memory limits on node) and dynamic parameters (such as latency increase, throughput degradation).
- Node level and shard level indexing pressure statistics exposed through stats api.
- Integration of Indexing pressure stats with Plugins for for metric visibility and auto-tuning in future.
- Control knobs to tune to the key performance thresholds which control rejections, to address any specific requirement or issues.
- Control knobs to run the feature in shadow-mode or enforced-mode. In shadow-mode only internal rejection breakdown metrics will be published while no actual rejections will be performed.

The changes were divided into small manageable chunks as part of the following PRs against a feature branch.

- Add Shard Indexing Pressure Settings. #716
- Add Shard Indexing Pressure Tracker. #717
- Refactor IndexingPressure to allow extension. #718
- Add Shard Indexing Pressure Store #838
- Add Shard Indexing Pressure Memory Manager #945
- Add ShardIndexingPressure framework level construct and Stats #1015
- Add Indexing Pressure Service which acts as orchestrator for IP #1084
- Add plumbing logic for IndexingPressureService in Transport Actions. #1113
- Add shard indexing pressure metric/stats via rest end point. #1171
- Add shard indexing pressure integration tests. #1198

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Rabi Panda <adnapibar@gmail.com>
getsaurabh02 added a commit to getsaurabh02/OpenSearch that referenced this pull request Oct 7, 2021
Shard level indexing pressure improves the current Indexing Pressure framework which performs memory accounting at node level and rejects the requests. This takes a step further to have rejections based on the memory accounting at shard level along with other key performance factors like throughput and last successful requests.

**Key features**
- Granular tracking of indexing tasks performance, at every shard level, for each node role i.e. coordinator, primary and replica.
- Smarter rejections by discarding the requests intended only for problematic index or shard, while still allowing others to continue (fairness in rejection).
- Rejections thresholds governed by combination of configurable parameters (such as memory limits on node) and dynamic parameters (such as latency increase, throughput degradation).
- Node level and shard level indexing pressure statistics exposed through stats api.
- Integration of Indexing pressure stats with Plugins for for metric visibility and auto-tuning in future.
- Control knobs to tune to the key performance thresholds which control rejections, to address any specific requirement or issues.
- Control knobs to run the feature in shadow-mode or enforced-mode. In shadow-mode only internal rejection breakdown metrics will be published while no actual rejections will be performed.

The changes were divided into small manageable chunks as part of the following PRs against a feature branch.

- Add Shard Indexing Pressure Settings. opensearch-project#716
- Add Shard Indexing Pressure Tracker. opensearch-project#717
- Refactor IndexingPressure to allow extension. opensearch-project#718
- Add Shard Indexing Pressure Store opensearch-project#838
- Add Shard Indexing Pressure Memory Manager opensearch-project#945
- Add ShardIndexingPressure framework level construct and Stats opensearch-project#1015
- Add Indexing Pressure Service which acts as orchestrator for IP opensearch-project#1084
- Add plumbing logic for IndexingPressureService in Transport Actions. opensearch-project#1113
- Add shard indexing pressure metric/stats via rest end point. opensearch-project#1171
- Add shard indexing pressure integration tests. opensearch-project#1198

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Rabi Panda <adnapibar@gmail.com>
tlfeng pushed a commit that referenced this pull request Oct 11, 2021
Shard level indexing pressure improves the current Indexing Pressure framework which performs memory accounting at node level and rejects the requests. This takes a step further to have rejections based on the memory accounting at shard level along with other key performance factors like throughput and last successful requests.

**Key features**
- Granular tracking of indexing tasks performance, at every shard level, for each node role i.e. coordinator, primary and replica.
- Smarter rejections by discarding the requests intended only for problematic index or shard, while still allowing others to continue (fairness in rejection).
- Rejections thresholds governed by combination of configurable parameters (such as memory limits on node) and dynamic parameters (such as latency increase, throughput degradation).
- Node level and shard level indexing pressure statistics exposed through stats api.
- Integration of Indexing pressure stats with Plugins for for metric visibility and auto-tuning in future.
- Control knobs to tune to the key performance thresholds which control rejections, to address any specific requirement or issues.
- Control knobs to run the feature in shadow-mode or enforced-mode. In shadow-mode only internal rejection breakdown metrics will be published while no actual rejections will be performed.

The changes were divided into small manageable chunks as part of the following PRs against a feature branch.

- Add Shard Indexing Pressure Settings. #716
- Add Shard Indexing Pressure Tracker. #717
- Refactor IndexingPressure to allow extension. #718
- Add Shard Indexing Pressure Store #838
- Add Shard Indexing Pressure Memory Manager #945
- Add ShardIndexingPressure framework level construct and Stats #1015
- Add Indexing Pressure Service which acts as orchestrator for IP #1084
- Add plumbing logic for IndexingPressureService in Transport Actions. #1113
- Add shard indexing pressure metric/stats via rest end point. #1171
- Add shard indexing pressure integration tests. #1198

Signed-off-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Saurabh Singh <sisurab@amazon.com>
Co-authored-by: Rabi Panda <adnapibar@gmail.com>
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.

4 participants