File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
server/src/main/java/org/elasticsearch/index/engine Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public class ThreadPoolMergeScheduler extends MergeScheduler implements Elastics
7777 * @param indexSettings used to obtain the {@link MergeSchedulerConfig}
7878 * @param threadPoolMergeExecutorService the executor service used to execute merge tasks from this scheduler
7979 * @param mergeMemoryEstimateProvider provides an estimate for how much memory a merge will take
80- * @param mergeMetrics
80+ * @param mergeMetrics metrics related to merges
8181 */
8282 public ThreadPoolMergeScheduler (
8383 ShardId shardId ,
@@ -540,7 +540,7 @@ public OnGoingMerge getOnGoingMerge() {
540540
541541 private static long getNewSegmentSize (MergePolicy .OneMerge currentMerge ) {
542542 try {
543- return currentMerge .getMergeInfo (). sizeInBytes ();
543+ return currentMerge .getMergeInfo () != null ? currentMerge . getMergeInfo (). sizeInBytes () : currentMerge . estimatedMergeBytes ;
544544 } catch (FileNotFoundException | NoSuchFileException e ) {
545545 // It is (rarely) possible that the merged segment could be merged away by the IndexWriter prior to reaching this point.
546546 // Once the IW creates the new segment, it could be exposed to be included in a new merge. That merge can be executed
You can’t perform that action at this time.
0 commit comments