From f15e242eb071f7c6af3ac38c0fb70776ec1977f6 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Fri, 23 Jun 2023 10:42:30 -0700 Subject: [PATCH] Handled different extension unique id Signed-off-by: Owais Kazi --- .../main/java/org/opensearch/transport/TransportService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/transport/TransportService.java b/server/src/main/java/org/opensearch/transport/TransportService.java index 9bd9ba39b315e..021bf39fc5a1f 100644 --- a/server/src/main/java/org/opensearch/transport/TransportService.java +++ b/server/src/main/java/org/opensearch/transport/TransportService.java @@ -544,7 +544,8 @@ public ConnectionManager.ConnectionValidator connectionValidatorForExtensionConn ) { return (newConnection, actualProfile, listener) -> { // We don't validate cluster names to allow for CCS connections. - if (Strings.isNullOrEmpty(threadPool.getThreadContext().getHeader("extension_unique_id"))) { + String currentId = threadPool.getThreadContext().getHeader("extension_unique_id"); + if (Strings.isNullOrEmpty(currentId) || !extensionUniqueId.equals(currentId)) { threadPool.getThreadContext().putHeader("extension_unique_id", extensionUniqueId); } handshake(newConnection, actualProfile.getHandshakeTimeout().millis(), cn -> true, ActionListener.map(listener, resp -> {