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 changes to propagate queryGroupId across child requests and nodes #14614

Merged
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
58303c6
add query group header propagator
kaushalmahi12 Jul 1, 2024
5efa3e3
apply spotless check
kaushalmahi12 Jul 1, 2024
ede0efa
add new propagator in ThreadContext
kaushalmahi12 Jul 1, 2024
51c5222
spotlessApply
kaushalmahi12 Jul 1, 2024
dfa53b1
address comments
kaushalmahi12 Jul 2, 2024
153134d
Bump com.microsoft.azure:msal4j from 1.15.1 to 1.16.0 in /plugins/rep…
dependabot[bot] Jul 1, 2024
ec9d435
[Bugfix] Fix ICacheKeySerializerTests flakiness (#14564)
peteralfonsi Jul 1, 2024
bda1bfa
Correct typo in method name (#14621)
imvtsl Jul 2, 2024
6abdba2
Refactoring FilterPath.parse by using an iterative approach instead o…
deshsidd Jul 2, 2024
38c9f82
Removing String format in RemoteStoreMigrationAllocationDecider to op…
RS146BIJAY Jul 3, 2024
a5b991e
Clear templates before Adding; Use NamedWriteableAwareStreamInput for…
soosinha Jul 3, 2024
b1b5f87
add changelog
kaushalmahi12 Jul 3, 2024
9a1c7b9
add PR link changelog
kaushalmahi12 Jul 3, 2024
cbcbb0e
Improve reroute performance by optimising List.removeAll in LocalShar…
RS146BIJAY Jul 4, 2024
1abe6b1
Fix assertion failure while deleting remote backed index (#14601)
sachinpkale Jul 5, 2024
1d20abe
Allow system index warning in OpenSearchRestTestCase.refreshAllIndice…
cwperks Jul 5, 2024
fe1983e
Star tree codec changes (#14514)
bharath-techie Jul 8, 2024
ba851fb
Bump com.github.spullara.mustache.java:compiler from 0.9.13 to 0.9.14…
dependabot[bot] Jul 8, 2024
3925aac
Bump net.minidev:accessors-smart from 2.5.0 to 2.5.1 in /plugins/repo…
dependabot[bot] Jul 8, 2024
aa7c560
Merge branch 'main' into feature/sandbox-qgHdrPropagatino
kaushalmahi12 Jul 8, 2024
eea2a2c
rebase with upstream
kaushalmahi12 Jul 10, 2024
7b21688
move query group thread context propagator out of ThreadContext
kaushalmahi12 Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing String format in RemoteStoreMigrationAllocationDecider to op…
…timise performance(#14612)

Signed-off-by: RS146BIJAY <rishavsagar4b1@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
  • Loading branch information
RS146BIJAY authored and kaushalmahi12 committed Jul 8, 2024
commit 38c9f82144575b70c0537553a76e5e929a00e4e0
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
import org.opensearch.node.remotestore.RemoteStoreNodeService.CompatibilityMode;
import org.opensearch.node.remotestore.RemoteStoreNodeService.Direction;

import java.util.Locale;

/**
* A new allocation decider for migration of document replication clusters to remote store backed clusters:
* - For STRICT compatibility mode, the decision is always YES
Expand Down Expand Up @@ -101,7 +99,7 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
if (migrationDirection.equals(Direction.NONE)) {
// remote backed indices on docrep nodes and non remote backed indices on remote nodes are not allowed
boolean isNoDecision = remoteSettingsBackedIndex ^ targetNode.isRemoteStoreNode();
String reason = String.format(Locale.ROOT, " for %sremote store backed index", remoteSettingsBackedIndex ? "" : "non ");
String reason = " for " + (remoteSettingsBackedIndex ? "" : "non ") + "remote store backed index";
return allocation.decision(
isNoDecision ? Decision.NO : Decision.YES,
NAME,
Expand All @@ -114,11 +112,9 @@ public Decision canAllocate(ShardRouting shardRouting, RoutingNode node, Routing
// check for remote store backed indices
if (remoteSettingsBackedIndex && targetNode.isRemoteStoreNode() == false) {
// allocations and relocations must be to a remote node
String reason = String.format(
Locale.ROOT,
" because a remote store backed index's shard copy can only be %s to a remote node",
((shardRouting.assignedToNode() == false) ? "allocated" : "relocated")
);
String reason = new StringBuilder(" because a remote store backed index's shard copy can only be ").append(
(shardRouting.assignedToNode() == false) ? "allocated" : "relocated"
).append(" to a remote node").toString();
return allocation.decision(Decision.NO, NAME, getDecisionDetails(false, shardRouting, targetNode, reason));
}

Expand Down Expand Up @@ -168,16 +164,18 @@ private Decision replicaShardDecision(ShardRouting replicaShardRouting, Discover

// get detailed reason for the decision
private String getDecisionDetails(boolean isYes, ShardRouting shardRouting, DiscoveryNode targetNode, String reason) {
return String.format(
Locale.ROOT,
"[%s migration_direction]: %s shard copy %s be %s to a %s node%s",
migrationDirection.direction,
(shardRouting.primary() ? "primary" : "replica"),
(isYes ? "can" : "can not"),
((shardRouting.assignedToNode() == false) ? "allocated" : "relocated"),
(targetNode.isRemoteStoreNode() ? "remote" : "non-remote"),
reason
);
return new StringBuilder("[").append(migrationDirection.direction)
.append(" migration_direction]: ")
.append(shardRouting.primary() ? "primary" : "replica")
.append(" shard copy ")
.append(isYes ? "can" : "can not")
.append(" be ")
.append((shardRouting.assignedToNode() == false) ? "allocated" : "relocated")
.append(" to a ")
.append(targetNode.isRemoteStoreNode() ? "remote" : "non-remote")
.append(" node")
.append(reason)
.toString();
}

}