Skip to content

Commit

Permalink
StreamAppenderator: Add sink prior to announcing it. (#17649)
Browse files Browse the repository at this point in the history
Fixes #17633.
  • Loading branch information
gianm authored Jan 22, 2025
1 parent a805f4b commit a964220
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ private Sink getOrCreateSink(final SegmentIdWithShardSpec identifier)
);
bytesCurrentlyInMemory.addAndGet(calculateSinkMemoryInUsed(retVal));

// Add sink prior to announcing it, to ensure it is immediately queryable.
addSink(identifier, retVal);

try {
segmentAnnouncer.announceSegment(retVal.getSegment());
}
Expand All @@ -536,8 +539,6 @@ private Sink getOrCreateSink(final SegmentIdWithShardSpec identifier)
.addData("interval", retVal.getInterval())
.emit();
}

addSink(identifier, retVal);
}

return retVal;
Expand Down

0 comments on commit a964220

Please sign in to comment.