|
@@ -33,7 +33,7 @@ namespace NKikimr::NPQ {
|
|
|
#define INFO(message) LOG_INFO_S(*NActors::TlsActivationContext, NKikimrServices::PQ_WRITE_PROXY, LOG_PREFIX << message);
|
|
|
#define ERROR(message) LOG_ERROR_S(*NActors::TlsActivationContext, NKikimrServices::PQ_WRITE_PROXY, LOG_PREFIX << message);
|
|
|
|
|
|
-static const ui64 WRITE_BLOCK_SIZE = 4_KB;
|
|
|
+static const ui64 WRITE_BLOCK_SIZE = 4_KB;
|
|
|
|
|
|
TString TEvPartitionWriter::TEvInitResult::TSuccess::ToString() const {
|
|
|
auto out = TStringBuilder() << "Success {"
|
|
@@ -106,7 +106,7 @@ class TPartitionWriter: public TActorBootstrapped<TPartitionWriter>, private TRl
|
|
|
using EErrorCode = TEvPartitionWriter::TEvWriteResponse::EErrorCode;
|
|
|
|
|
|
static constexpr size_t MAX_QUOTA_INFLIGHT = 3;
|
|
|
-
|
|
|
+
|
|
|
static void FillHeader(NKikimrClient::TPersQueuePartitionRequest& request,
|
|
|
ui32 partitionId, const TActorId& pipeClient)
|
|
|
{
|
|
@@ -292,11 +292,7 @@ class TPartitionWriter: public TActorBootstrapped<TPartitionWriter>, private TRl
|
|
|
|
|
|
auto& request = *ev->Record.MutablePartitionRequest();
|
|
|
auto& cmd = *request.MutableCmdGetOwnership();
|
|
|
- if (Opts.UseDeduplication) {
|
|
|
- cmd.SetOwner(SourceId);
|
|
|
- } else {
|
|
|
- cmd.SetOwner(CreateGuidAsString());
|
|
|
- }
|
|
|
+ cmd.SetOwner(SourceId);
|
|
|
cmd.SetForce(true);
|
|
|
|
|
|
SetWriteId(request);
|
|
@@ -742,16 +738,16 @@ class TPartitionWriter: public TActorBootstrapped<TPartitionWriter>, private TRl
|
|
|
ReceivedQuota.insert(ReceivedQuota.end(), PendingQuota.begin(), PendingQuota.end());
|
|
|
PendingQuota.clear();
|
|
|
|
|
|
- ProcessQuotaAndWrite();
|
|
|
+ ProcessQuotaAndWrite();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case EWakeupTag::RlNoResource:
|
|
|
- // Re-requesting the quota. We do this until we get a quota.
|
|
|
+ // Re-requesting the quota. We do this until we get a quota.
|
|
|
// We do not request a quota with a long waiting time because the writer may already be a destroyer, and the quota will still be waiting to be received.
|
|
|
RequestDataQuota(PendingQuotaAmount, ctx);
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
default:
|
|
|
Y_VERIFY_DEBUG_S(false, "Unsupported tag: " << static_cast<ui64>(tag));
|
|
|
}
|
|
@@ -772,7 +768,7 @@ public:
|
|
|
, TabletId(tabletId)
|
|
|
, PartitionId(partitionId)
|
|
|
, ExpectedGeneration(opts.ExpectedGeneration)
|
|
|
- , SourceId(opts.SourceId)
|
|
|
+ , SourceId(opts.UseDeduplication ? opts.SourceId : CreateGuidAsString())
|
|
|
, Opts(opts)
|
|
|
{
|
|
|
if (Opts.MeteringMode) {
|
|
@@ -858,7 +854,7 @@ private:
|
|
|
IActor* CreatePartitionWriter(const TActorId& client,
|
|
|
// const NKikimrSchemeOp::TPersQueueGroupDescription& config,
|
|
|
ui64 tabletId,
|
|
|
- ui32 partitionId,
|
|
|
+ ui32 partitionId,
|
|
|
const TPartitionWriterOpts& opts) {
|
|
|
return new TPartitionWriter(client, tabletId, partitionId, opts);
|
|
|
}
|