From f97aec7b8b453e01d91f9c0ddaab5bd767e57275 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Wed, 18 Apr 2018 11:54:00 -0400 Subject: [PATCH] Sibling of enforce access to translog via engine Since elastic/elasticsearch#29542, we no longer expose translog instance but only provide creating translog snapshot method. This commit adapts that change in CCR branch. Relates elastic/elasticsearch#29542 --- .../org/elasticsearch/xpack/ccr/action/ShardChangesAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java index b99f2cecc39..d5c774f53a0 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/ShardChangesAction.java @@ -262,7 +262,7 @@ public class ShardChangesAction extends Action orderedOps = new PriorityQueue<>(Comparator.comparingLong(Translog.Operation::seqNo)); final List operations = new ArrayList<>(); - try (Translog.Snapshot snapshot = indexShard.getTranslog().getSnapshotBetween(minSeqNo, maxSeqNo)) { + try (Translog.Snapshot snapshot = indexShard.newTranslogSnapshotBetween(minSeqNo, maxSeqNo)) { for (Translog.Operation unorderedOp = snapshot.next(); unorderedOp != null; unorderedOp = snapshot.next()) { if (unorderedOp.seqNo() < minSeqNo || unorderedOp.seqNo() > maxSeqNo) { continue;