Skip to content

Commit dfe18d7

Browse files
committed
Revert "Optimizations for ReadOnlyEngine"
This reverts commit e57c2d9.
1 parent 6972a1d commit dfe18d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/index/engine/ReadOnlyEngine.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ public Closeable acquireHistoryRetentionLock() {
358358

359359
@Override
360360
public int countChanges(String source, long fromSeqNo, long toSeqNo) throws IOException {
361-
return 0;
361+
try (Translog.Snapshot snapshot = newChangesSnapshot(source, fromSeqNo, toSeqNo, false, true, true, -1)) {
362+
return snapshot.totalOperations();
363+
}
362364
}
363365

364366
@Override
@@ -500,9 +502,7 @@ public SafeCommitInfo getSafeCommitInfo() {
500502
}
501503

502504
@Override
503-
public void activateThrottling() {
504-
assert false : "read only engine does not ingest and thus should not be throttled";
505-
}
505+
public void activateThrottling() {}
506506

507507
@Override
508508
public void deactivateThrottling() {}

0 commit comments

Comments
 (0)