Skip to content

Commit e156140

Browse files
author
hiddenpath
committed
YT-25104: Align new writer behaviour with the oldest ones
commit_hash:a33872f7bf427339504d82c86c97504eb38757d9
1 parent 587d6bb commit e156140

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

yt/cpp/mapreduce/client/client_writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TClientWriter::TClientWriter(
3636
} else {
3737
bool useV2Writer = context.Config->TableWriterVersion == ETableWriterVersion::V2;
3838
if (useV2Writer) {
39-
auto serializedWriterOptions = FormIORequestParameters(options);
39+
auto serializedWriterOptions = FormIORequestParameters(path, options);
4040

4141
RawWriter_ = MakeIntrusive<NPrivate::TRetryfulWriterV2>(
4242
rawClient,

yt/cpp/mapreduce/client/retry_heavy_write_request.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void THeavyRequestRetrier::Retry(const std::function<void()> &function)
6767
function();
6868
return;
6969
} catch (const std::exception& ex) {
70-
YT_LOG_ERROR("RSP %v - attempt %v failed",
70+
YT_LOG_ERROR("RSP %v - %v failed",
7171
Attempt_->RequestId,
7272
RequestRetryPolicy_->GetAttemptDescription());
7373
Attempt_.reset();
@@ -89,6 +89,7 @@ void THeavyRequestRetrier::Retry(const std::function<void()> &function)
8989
throw;
9090
}
9191
NDetail::TWaitProxy::Get()->Sleep(*backoffDuration);
92+
RequestRetryPolicy_->NotifyNewAttempt();
9293
}
9394
}
9495
}

yt/cpp/mapreduce/client/retryful_writer_v2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ void TRetryfulWriterV2::DoStartBatch()
389389

390390
void TRetryfulWriterV2::DoWrite(const void* buf, size_t len)
391391
{
392+
if (!Sender_) {
393+
throw TApiUsageError() << "Cannot use table writer that is finished";
394+
}
392395
Current_->Buffer.Append(buf, len);
393396
auto currentSize = Current_->Buffer.Size();
394397
if (currentSize >= NextSizeToSend_) {

0 commit comments

Comments
 (0)