Skip to content

Federation mode with tx counters test #9523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions ydb/core/persqueue/ut/partition_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ TPartition* TPartitionFixture::CreatePartitionActor(const TPartitionId& id,
config.MeteringMode);
Config.SetLocalDC(true);

NPersQueue::TTopicNamesConverterFactory factory(true, "/Root/PQ", "dc1");
NPersQueue::TTopicNamesConverterFactory factory(Ctx->Runtime->GetAppData(0).PQConfig.GetTopicsAreFirstClassCitizen(), "/Root/PQ", "dc1");
TopicConverter = factory.MakeTopicConverter(Config);
TActorId quoterId;
if (Ctx->Runtime->GetAppData(0).PQConfig.GetQuotingConfig().GetEnableQuoting()) {
Expand Down Expand Up @@ -1324,6 +1324,8 @@ class TPartitionTxTestHelper : public TPartitionFixture {
void ExpectNoBatchCompletion();
void WaitBatchCompletion(ui64 userActsCount);
void ResetBatchCompletion();

void NonConflictingActsBatchOkTest();
};

ui64 TPartitionTxTestHelper::MakeAndSendNormalOffsetCommit(ui64 client, ui64 offset) {
Expand Down Expand Up @@ -1370,6 +1372,11 @@ void TPartitionTxTestHelper::SendWriteInfoResponseImpl(const TActorId& supportiv
auto iter = this->WriteInfoData.find(supportiveId);
Y_ABORT_UNLESS(!iter.IsEnd());
reply->SrcIdInfo = iter->second;
reply->BytesWrittenTotal = 1;
reply->BytesWrittenGrpc = 1;
reply->BytesWrittenUncompressed = 1;
reply->MessagesWrittenTotal = 1;
reply->MessagesWrittenGrpc = 1;
SendEvent(reply, supportiveId, partitionId);
}

Expand Down Expand Up @@ -2549,7 +2556,7 @@ Y_UNIT_TEST_F(DataTxCalcPredicateOrder, TPartitionTxTestHelper)
WaitCommitDone(tx2);
}

Y_UNIT_TEST_F(NonConflictingActsBatchOk, TPartitionTxTestHelper) {
void TPartitionTxTestHelper::NonConflictingActsBatchOkTest() {
TTxBatchingTestParams params {.WriterSessions{"src3", "src4"}};
Init(std::move(params));
ResetBatchCompletion();
Expand Down Expand Up @@ -2592,6 +2599,14 @@ Y_UNIT_TEST_F(NonConflictingActsBatchOk, TPartitionTxTestHelper) {
WaitImmediateTxComplete(immTx2, true);
WaitCommitDone(tx3);
}
Y_UNIT_TEST_F(TestNonConflictingActsBatchOk, TPartitionTxTestHelper) {
NonConflictingActsBatchOkTest();
}

Y_UNIT_TEST_F(TestTxBatchInFederation, TPartitionTxTestHelper) {
Ctx->Runtime->GetAppData(0).PQConfig.SetTopicsAreFirstClassCitizen(false);
NonConflictingActsBatchOkTest();
}

Y_UNIT_TEST_F(ConflictingActsInSeveralBatches, TPartitionTxTestHelper) {
TTxBatchingTestParams params {.WriterSessions{"src1", "src4"},.EndOffset=1};
Expand Down Expand Up @@ -3125,6 +3140,8 @@ Y_UNIT_TEST_F(TestBatchingWithProposeConfig, TPartitionTxTestHelper) {
WaitImmediateTxComplete(immTx2, true);
}



Y_UNIT_TEST_F(GetUsedStorage, TPartitionFixture) {
auto* actor = CreatePartition({
.Partition=TPartitionId{2, TWriteId{0, 10}, 100'001},
Expand Down
Loading