Skip to content

Commit faff5fb

Browse files
committed
YT-21942: Fix some bugs in adaptive row count mechanics
commit_hash:e4863185d0a54cb33733e0741baf20b7aa2cd612
1 parent db23547 commit faff5fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

yt/yt/client/table_client/adapters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void PipeReaderToWriterByBatches(
225225
try {
226226
TPeriodicYielder yielder(TDuration::Seconds(1));
227227

228-
while (auto batch = reader->Read(options)) {
228+
for (bool isFirstBatch = true; auto batch = reader->Read(options); isFirstBatch = false) {
229229
yielder.TryYield();
230230

231231
if (batch->IsEmpty()) {
@@ -251,7 +251,7 @@ void PipeReaderToWriterByBatches(
251251
.ThrowOnError();
252252
}
253253

254-
if (optionsUpdater) {
254+
if (optionsUpdater && !isFirstBatch) {
255255
options.MaxRowsPerRead = rowsRead;
256256
optionsUpdater(&options, timer.GetElapsedTime());
257257
}

0 commit comments

Comments
 (0)