@@ -146,6 +146,8 @@ class TFixture : public NUnitTest::TBaseFixture {
146146
147147 void TestTxWithBigBlobs (const TTestTxWithBigBlobsParams& params);
148148
149+ void WriteMessagesInTx (size_t big, size_t small);
150+
149151 const TDriver& GetDriver () const ;
150152
151153 void CheckTabletKeys (const TString& topicName);
@@ -1595,21 +1597,22 @@ void TFixture::TestTxWithBigBlobs(const TTestTxWithBigBlobsParams& params)
15951597
15961598 for (size_t i = 0 ; i < params.OldHeadCount ; ++i) {
15971599 WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (100'000 , ' x' ));
1600+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
15981601 ++oldHeadMsgCount;
15991602 }
16001603
16011604 for (size_t i = 0 ; i < params.BigBlobsCount ; ++i) {
1602- WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'900'000 , ' x' ), &tx);
1605+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'000'000 , ' x' ), &tx);
1606+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
16031607 ++bigBlobMsgCount;
16041608 }
16051609
16061610 for (size_t i = 0 ; i < params.NewHeadCount ; ++i) {
16071611 WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (100'000 , ' x' ), &tx);
1612+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
16081613 ++newHeadMsgCount;
16091614 }
16101615
1611- WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1612-
16131616 if (params.RestartMode == ERestartBeforeCommit) {
16141617 RestartPQTablet (" topic_A" , 0 );
16151618 }
@@ -1638,7 +1641,7 @@ void TFixture::TestTxWithBigBlobs(const TTestTxWithBigBlobsParams& params)
16381641 start += oldHeadMsgCount;
16391642
16401643 for (size_t i = 0 ; i < bigBlobMsgCount; ++i) {
1641- UNIT_ASSERT_VALUES_EQUAL (messages[start + i].size (), 7'900 '000 );
1644+ UNIT_ASSERT_VALUES_EQUAL (messages[start + i].size (), 7'000 '000 );
16421645 }
16431646 start += bigBlobMsgCount;
16441647
@@ -1903,6 +1906,90 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_28, TFixture)
19031906 UNIT_ASSERT_VALUES_EQUAL (messages.size (), 2 );
19041907}
19051908
1909+ void TFixture::WriteMessagesInTx (size_t big, size_t small)
1910+ {
1911+ CreateTopic (" topic_A" , TEST_CONSUMER);
1912+
1913+ NTable::TSession tableSession = CreateTableSession ();
1914+ NTable::TTransaction tx = BeginTx (tableSession);
1915+
1916+ for (size_t i = 0 ; i < big; ++i) {
1917+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'000'000 , ' x' ), &tx, 0 );
1918+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1919+ }
1920+
1921+ for (size_t i = 0 ; i < small; ++i) {
1922+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (16'384 , ' x' ), &tx, 0 );
1923+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1924+ }
1925+
1926+ CommitTx (tx, EStatus::SUCCESS);
1927+ }
1928+
1929+ Y_UNIT_TEST_F (WriteToTopic_Demo_29, TFixture)
1930+ {
1931+ WriteMessagesInTx (1 , 0 );
1932+ WriteMessagesInTx (1 , 0 );
1933+ }
1934+
1935+ Y_UNIT_TEST_F (WriteToTopic_Demo_30, TFixture)
1936+ {
1937+ WriteMessagesInTx (1 , 0 );
1938+ WriteMessagesInTx (0 , 1 );
1939+ }
1940+
1941+ Y_UNIT_TEST_F (WriteToTopic_Demo_31, TFixture)
1942+ {
1943+ WriteMessagesInTx (1 , 0 );
1944+ WriteMessagesInTx (1 , 1 );
1945+ }
1946+
1947+ Y_UNIT_TEST_F (WriteToTopic_Demo_32, TFixture)
1948+ {
1949+ WriteMessagesInTx (0 , 1 );
1950+ WriteMessagesInTx (1 , 0 );
1951+ }
1952+
1953+ Y_UNIT_TEST_F (WriteToTopic_Demo_33, TFixture)
1954+ {
1955+ WriteMessagesInTx (0 , 1 );
1956+ WriteMessagesInTx (0 , 1 );
1957+ }
1958+
1959+ Y_UNIT_TEST_F (WriteToTopic_Demo_34, TFixture)
1960+ {
1961+ WriteMessagesInTx (0 , 1 );
1962+ WriteMessagesInTx (1 , 1 );
1963+ }
1964+
1965+ Y_UNIT_TEST_F (WriteToTopic_Demo_35, TFixture)
1966+ {
1967+ WriteMessagesInTx (1 , 1 );
1968+ WriteMessagesInTx (1 , 0 );
1969+ }
1970+
1971+ Y_UNIT_TEST_F (WriteToTopic_Demo_36, TFixture)
1972+ {
1973+ WriteMessagesInTx (1 , 1 );
1974+ WriteMessagesInTx (0 , 1 );
1975+ }
1976+
1977+ Y_UNIT_TEST_F (WriteToTopic_Demo_37, TFixture)
1978+ {
1979+ WriteMessagesInTx (1 , 1 );
1980+ WriteMessagesInTx (1 , 1 );
1981+ }
1982+
1983+
1984+ Y_UNIT_TEST_F (WriteToTopic_Demo_38, TFixture)
1985+ {
1986+ WriteMessagesInTx (2 , 202 );
1987+ WriteMessagesInTx (2 , 200 );
1988+ WriteMessagesInTx (0 , 1 );
1989+ WriteMessagesInTx (4 , 0 );
1990+ WriteMessagesInTx (0 , 1 );
1991+ }
1992+
19061993}
19071994
19081995}
0 commit comments