Skip to content

Commit

Permalink
ensure that we can buffer at least one document
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczi committed Dec 9, 2024
1 parent 3d290aa commit a0fa3fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3145,7 +3145,7 @@ public Translog.Snapshot newChangesSnapshot(
boolean singleConsumer,
boolean accessStats
) throws IOException {
return newChangesSnapshot(source, fromSeqNo, toSeqNo, requiredFullRange, singleConsumer, accessStats, 0);
return newChangesSnapshot(source, fromSeqNo, toSeqNo, requiredFullRange, singleConsumer, accessStats, -1);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public LuceneSyntheticSourceChangesSnapshot(
) throws IOException {
super(engineSearcher, searchBatchSize, fromSeqNo, toSeqNo, requiredFullRange, accessStats, indexVersionCreated);
assert mappingLookup.isSourceSynthetic();
this.maxMemorySizeInBytes = maxMemorySizeInBytes;
// ensure we can buffer at least one document
this.maxMemorySizeInBytes = maxMemorySizeInBytes > 0 ? maxMemorySizeInBytes : 1;
this.sourceLoader = mappingLookup.newSourceLoader(SourceFieldMetrics.NOOP);
Set<String> storedFields = sourceLoader.requiredStoredFields();
assert mappingLookup.isSourceSynthetic() : "synthetic source must be enabled for proper functionality.";
Expand Down

0 comments on commit a0fa3fd

Please sign in to comment.