diff options
author | Nikolay Shestakov <tesseract@ydb.tech> | 2024-03-01 14:48:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 16:48:38 +0500 |
commit | 0e0399a20d3565a47d42a7d677122941b7132f3c (patch) | |
tree | d36de52868d0414fd5d33c666538b9b9b48ff5c7 | |
parent | 7c1e20bdb0eea21b5218168ac7fd553a41776bb7 (diff) | |
download | ydb-0e0399a20d3565a47d42a7d677122941b7132f3c.tar.gz |
Improove tablet generation value in Topic protocol (#2375)
-rw-r--r-- | .github/config/muted_ya.txt | 1 | ||||
-rw-r--r-- | ydb/core/persqueue/partition.cpp | 2 | ||||
-rw-r--r-- | ydb/services/persqueue_v1/actors/partition_actor.cpp | 7 | ||||
-rw-r--r-- | ydb/services/persqueue_v1/persqueue_ut.cpp | 8 |
4 files changed, 8 insertions, 10 deletions
diff --git a/.github/config/muted_ya.txt b/.github/config/muted_ya.txt index ecb3bdf9505..184132decc2 100644 --- a/.github/config/muted_ya.txt +++ b/.github/config/muted_ya.txt @@ -57,7 +57,6 @@ ydb/services/persqueue_v1/ut TPersQueueTest.CheckACLForGrpcWrite ydb/services/persqueue_v1/ut TPersQueueTest.DirectRead* ydb/services/persqueue_v1/ut TPersQueueTest.SetupLockSession ydb/services/persqueue_v1/ut TPersQueueTest.TopicServiceCommitOffsetBadOffsets -ydb/services/persqueue_v1/ut TPersQueueTest.UpdatePartitionLocation ydb/services/persqueue_v1/ut TPQCompatTest.BadTopics ydb/services/persqueue_v1/ut [3/10]* ydb/services/ydb/sdk_sessions_pool_ut YdbSdkSessionsPool.StressTestSync* diff --git a/ydb/core/persqueue/partition.cpp b/ydb/core/persqueue/partition.cpp index a5a25bec724..97c087a5ecf 100644 --- a/ydb/core/persqueue/partition.cpp +++ b/ydb/core/persqueue/partition.cpp @@ -520,7 +520,7 @@ void TPartition::InitComplete(const TActorContext& ctx) { LOG_INFO_S( ctx, NKikimrServices::PERSQUEUE, - "init complete for topic '" << TopicName() << "' partition " << Partition << " " << ctx.SelfID + "init complete for topic '" << TopicName() << "' partition " << Partition << " generation " << TabletGeneration << " " << ctx.SelfID ); TStringBuilder ss; diff --git a/ydb/services/persqueue_v1/actors/partition_actor.cpp b/ydb/services/persqueue_v1/actors/partition_actor.cpp index dd736fc68d3..6e22363df04 100644 --- a/ydb/services/persqueue_v1/actors/partition_actor.cpp +++ b/ydb/services/persqueue_v1/actors/partition_actor.cpp @@ -593,7 +593,7 @@ void TPartitionActor::Handle(TEvPersQueue::TEvResponse::TPtr& ev, const TActorCo if (!StartReading) { - ctx.Send(ParentId, new TEvPQProxy::TEvPartitionStatus(Partition, CommittedOffset, EndOffset, WriteTimestampEstimateMs, TabletGeneration, NodeId)); + ctx.Send(ParentId, new TEvPQProxy::TEvPartitionStatus(Partition, CommittedOffset, EndOffset, WriteTimestampEstimateMs, NodeId, TabletGeneration)); } else { InitStartReading(ctx); } @@ -802,15 +802,14 @@ void TPartitionActor::Handle(TEvTabletPipe::TEvClientConnected::TPtr& ev, const TEvTabletPipe::TEvClientConnected *msg = ev->Get(); LOG_INFO_S(ctx, NKikimrServices::PQ_READ_PROXY, PQ_LOG_PREFIX << " " << Partition - << " pipe restart attempt " << PipeGeneration << " pipe creation result: " << msg->Status); + << " pipe restart attempt " << PipeGeneration << " pipe creation result: " << msg->Status + << " TabletId: " << msg->TabletId << " Generation: " << msg->Generation); if (msg->Status != NKikimrProto::OK) { RestartPipe(ctx, TStringBuilder() << "pipe to tablet is dead " << msg->TabletId, NPersQueue::NErrorCode::TABLET_PIPE_DISCONNECTED); return; } - auto prevGeneration = TabletGeneration; - Y_UNUSED(prevGeneration); TabletGeneration = msg->Generation; NodeId = msg->ServerId.NodeId(); diff --git a/ydb/services/persqueue_v1/persqueue_ut.cpp b/ydb/services/persqueue_v1/persqueue_ut.cpp index 312604fe48c..8dda9b78303 100644 --- a/ydb/services/persqueue_v1/persqueue_ut.cpp +++ b/ydb/services/persqueue_v1/persqueue_ut.cpp @@ -716,7 +716,7 @@ Y_UNIT_TEST_SUITE(TPersQueueTest) { TPersQueueV1TestServer server; SET_LOCALS; MAKE_INSECURE_STUB(Ydb::Topic::V1::TopicService); - server.EnablePQLogs({ NKikimrServices::PQ_METACACHE, NKikimrServices::PQ_READ_PROXY}); + server.EnablePQLogs({ NKikimrServices::PQ_METACACHE, NKikimrServices::PQ_READ_PROXY, NKikimrServices::PERSQUEUE}); server.EnablePQLogs({ NKikimrServices::KQP_PROXY }, NLog::EPriority::PRI_EMERG); server.EnablePQLogs({ NKikimrServices::FLAT_TX_SCHEMESHARD }, NLog::EPriority::PRI_ERROR); @@ -742,8 +742,8 @@ Y_UNIT_TEST_SUITE(TPersQueueTest) { } // await and confirm CreatePartitionStreamRequest from server - i64 assignId = 0; - i64 generation = 0; + i64 assignId; + i64 generation; { Ydb::Topic::StreamReadMessage::FromServer resp; @@ -756,8 +756,8 @@ Y_UNIT_TEST_SUITE(TPersQueueTest) { UNIT_ASSERT_VALUES_EQUAL(resp.start_partition_session_request().partition_session().path(), "acc/topic1"); UNIT_ASSERT(resp.start_partition_session_request().partition_session().partition_id() == 0); UNIT_ASSERT(resp.start_partition_session_request().partition_location().generation() > 0); - generation = resp.start_partition_session_request().partition_location().generation(); assignId = resp.start_partition_session_request().partition_session().partition_session_id(); + generation = resp.start_partition_session_request().partition_location().generation(); } server.Server->AnnoyingClient->RestartPartitionTablets(server.Server->CleverServer->GetRuntime(), "rt3.dc1--acc--topic1"); |