Skip to content

Commit

Permalink
Subscribe to pipe state (#5685)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberROFL authored Jun 18, 2024
1 parent 40bcf99 commit 9b24426
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ydb/core/tx/replication/service/table_writer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TTablePartitionWriter: public TActorBootstrapped<TTablePartitionWriter<TCh
event->Record.SetSource(source);
}

this->Send(LeaderPipeCache, new TEvPipeCache::TEvForward(event.Release(), TabletId, false));
this->Send(LeaderPipeCache, new TEvPipeCache::TEvForward(event.Release(), TabletId, true, ++SubscribeCookie));
this->Become(&TThis::StateWaitingStatus);
}

Expand Down Expand Up @@ -140,7 +140,7 @@ class TTablePartitionWriter: public TActorBootstrapped<TTablePartitionWriter<TCh
}

void Handle(TEvPipeCache::TEvDeliveryProblem::TPtr& ev) {
if (TabletId == ev->Get()->TabletId) {
if (TabletId == ev->Get()->TabletId && ev->Cookie == SubscribeCookie) {
Leave();
}
}
Expand Down Expand Up @@ -194,7 +194,9 @@ class TTablePartitionWriter: public TActorBootstrapped<TTablePartitionWriter<TCh
mutable TMaybe<TString> LogPrefix;

TActorId LeaderPipeCache;
ui64 SubscribeCookie = 0;
TChangeRecordBuilderContextTrait<TChangeRecord> BuilderContext;

}; // TTablePartitionWriter

template <class TChangeRecord>
Expand Down Expand Up @@ -421,7 +423,7 @@ class TLocalTableWriter
return new TTablePartitionWriter<TChangeRecord>(this->SelfId(), partitionId, TTableId(this->PathId, Schema->Version));
}

const TVector<TKeyDesc::TPartitionInfo>& GetPartitions() const override { return KeyDesc->GetPartitions(); };
const TVector<TKeyDesc::TPartitionInfo>& GetPartitions() const override { return KeyDesc->GetPartitions(); }
const TVector<NScheme::TTypeInfo>& GetSchema() const override { return KeyDesc->KeyColumnTypes; }
NKikimrSchemeOp::ECdcStreamFormat GetStreamFormat() const override { return TChangeRecord::StreamType; }

Expand Down

0 comments on commit 9b24426

Please sign in to comment.