Skip to content

Commit d52e3ac

Browse files
committed
Added test for reproduce memory travel
1 parent 8437590 commit d52e3ac

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

ydb/core/persqueue/ut/common/autoscaling_ut_common.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ TTopicSdkTestSetup CreateSetup() {
113113
setup.GetRuntime().GetAppData().PQConfig.SetTopicsAreFirstClassCitizen(true);
114114
setup.GetRuntime().GetAppData().PQConfig.SetUseSrcIdMetaMappingInFirstClass(true);
115115
setup.GetRuntime().GetAppData().PQConfig.SetBalancerWakeupIntervalSec(1);
116+
setup.GetRuntime().GetAppData().PQConfig.SetACLRetryTimeoutSec(1);
116117

117118
return setup;
118119
}

ydb/core/persqueue/ut/ut_with_sdk/commitoffset_ut.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,49 @@ Y_UNIT_TEST_SUITE(CommitOffset) {
618618
return true;
619619
});
620620
}
621+
622+
Y_UNIT_TEST(DistributedTxCommit_LongReadSession) {
623+
TTopicSdkTestSetup setup = CreateSetup();
624+
PrepareAutopartitionedTopic(setup);
625+
626+
std::vector<NYdb::NTopic::TReadSessionEvent::TDataReceivedEvent> messages;
627+
628+
auto result = setup.Read(TEST_TOPIC, TEST_CONSUMER, [&](auto& x) {
629+
messages.push_back(x);
630+
return true;
631+
});
632+
633+
{
634+
Cerr << ">>>>> Alter topic" << Endl << Flush;
635+
TTopicClient client(setup.MakeDriver());
636+
TAlterTopicSettings settings;
637+
settings.SetRetentionPeriod(TDuration::Hours(1));
638+
client.AlterTopic(TEST_TOPIC, settings).GetValueSync();
639+
}
640+
641+
// Wait recheck acl happened
642+
messages[0].GetMessages()[0].Commit(); // trigger recheck
643+
Sleep(TDuration::Seconds(5));
644+
645+
Cerr << ">>>>> Commit message" << Endl << Flush;
646+
647+
bool first = true;
648+
for (auto& e : messages) {
649+
for (auto& m :e.GetMessages()) {
650+
if (first) {
651+
first = false;
652+
continue;
653+
}
654+
m.Commit();
655+
}
656+
}
657+
658+
// Wait commit happened
659+
Sleep(TDuration::Seconds(5));
660+
661+
result.Reader->Close();
662+
}
663+
621664
}
622665

623666
} // namespace NKikimr

0 commit comments

Comments
 (0)