Skip to content

Commit 5440a6b

Browse files
Federation mode with tx counters test (#9523)
1 parent 3239a21 commit 5440a6b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

ydb/core/persqueue/ut/partition_ut.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ TPartition* TPartitionFixture::CreatePartitionActor(const TPartitionId& id,
352352
config.MeteringMode);
353353
Config.SetLocalDC(true);
354354

355-
NPersQueue::TTopicNamesConverterFactory factory(true, "/Root/PQ", "dc1");
355+
NPersQueue::TTopicNamesConverterFactory factory(Ctx->Runtime->GetAppData(0).PQConfig.GetTopicsAreFirstClassCitizen(), "/Root/PQ", "dc1");
356356
TopicConverter = factory.MakeTopicConverter(Config);
357357
TActorId quoterId;
358358
if (Ctx->Runtime->GetAppData(0).PQConfig.GetQuotingConfig().GetEnableQuoting()) {
@@ -1323,6 +1323,8 @@ class TPartitionTxTestHelper : public TPartitionFixture {
13231323
void ExpectNoBatchCompletion();
13241324
void WaitBatchCompletion(ui64 userActsCount);
13251325
void ResetBatchCompletion();
1326+
1327+
void NonConflictingActsBatchOkTest();
13261328
};
13271329

13281330
ui64 TPartitionTxTestHelper::MakeAndSendNormalOffsetCommit(ui64 client, ui64 offset) {
@@ -1369,6 +1371,11 @@ void TPartitionTxTestHelper::SendWriteInfoResponseImpl(const TActorId& supportiv
13691371
auto iter = this->WriteInfoData.find(supportiveId);
13701372
Y_ABORT_UNLESS(!iter.IsEnd());
13711373
reply->SrcIdInfo = iter->second;
1374+
reply->BytesWrittenTotal = 1;
1375+
reply->BytesWrittenGrpc = 1;
1376+
reply->BytesWrittenUncompressed = 1;
1377+
reply->MessagesWrittenTotal = 1;
1378+
reply->MessagesWrittenGrpc = 1;
13721379
SendEvent(reply, supportiveId, partitionId);
13731380
}
13741381

@@ -2548,7 +2555,7 @@ Y_UNIT_TEST_F(DataTxCalcPredicateOrder, TPartitionTxTestHelper)
25482555
WaitCommitDone(tx2);
25492556
}
25502557

2551-
Y_UNIT_TEST_F(NonConflictingActsBatchOk, TPartitionTxTestHelper) {
2558+
void TPartitionTxTestHelper::NonConflictingActsBatchOkTest() {
25522559
TTxBatchingTestParams params {.WriterSessions{"src3", "src4"}};
25532560
Init(std::move(params));
25542561
ResetBatchCompletion();
@@ -2591,6 +2598,14 @@ Y_UNIT_TEST_F(NonConflictingActsBatchOk, TPartitionTxTestHelper) {
25912598
WaitImmediateTxComplete(immTx2, true);
25922599
WaitCommitDone(tx3);
25932600
}
2601+
Y_UNIT_TEST_F(TestNonConflictingActsBatchOk, TPartitionTxTestHelper) {
2602+
NonConflictingActsBatchOkTest();
2603+
}
2604+
2605+
Y_UNIT_TEST_F(TestTxBatchInFederation, TPartitionTxTestHelper) {
2606+
Ctx->Runtime->GetAppData(0).PQConfig.SetTopicsAreFirstClassCitizen(false);
2607+
NonConflictingActsBatchOkTest();
2608+
}
25942609

25952610
Y_UNIT_TEST_F(ConflictingActsInSeveralBatches, TPartitionTxTestHelper) {
25962611
TTxBatchingTestParams params {.WriterSessions{"src1", "src4"},.EndOffset=1};
@@ -3124,6 +3139,8 @@ Y_UNIT_TEST_F(TestBatchingWithProposeConfig, TPartitionTxTestHelper) {
31243139
WaitImmediateTxComplete(immTx2, true);
31253140
}
31263141

3142+
3143+
31273144
Y_UNIT_TEST_F(GetUsedStorage, TPartitionFixture) {
31283145
auto* actor = CreatePartition({
31293146
.Partition=TPartitionId{2, TWriteId{0, 10}, 100'001},

0 commit comments

Comments
 (0)