@@ -152,6 +152,8 @@ class TFixture : public NUnitTest::TBaseFixture {
152
152
153
153
void TestTxWithBigBlobs (const TTestTxWithBigBlobsParams& params);
154
154
155
+ void WriteMessagesInTx (size_t big, size_t small);
156
+
155
157
const TDriver& GetDriver () const ;
156
158
157
159
void CheckTabletKeys (const TString& topicName);
@@ -1611,21 +1613,22 @@ void TFixture::TestTxWithBigBlobs(const TTestTxWithBigBlobsParams& params)
1611
1613
1612
1614
for (size_t i = 0 ; i < params.OldHeadCount ; ++i) {
1613
1615
WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (100'000 , ' x' ));
1616
+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1614
1617
++oldHeadMsgCount;
1615
1618
}
1616
1619
1617
1620
for (size_t i = 0 ; i < params.BigBlobsCount ; ++i) {
1618
- WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'900'000 , ' x' ), &tx);
1621
+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'000'000 , ' x' ), &tx);
1622
+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1619
1623
++bigBlobMsgCount;
1620
1624
}
1621
1625
1622
1626
for (size_t i = 0 ; i < params.NewHeadCount ; ++i) {
1623
1627
WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (100'000 , ' x' ), &tx);
1628
+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1624
1629
++newHeadMsgCount;
1625
1630
}
1626
1631
1627
- WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1628
-
1629
1632
if (params.RestartMode == ERestartBeforeCommit) {
1630
1633
RestartPQTablet (" topic_A" , 0 );
1631
1634
}
@@ -1654,7 +1657,7 @@ void TFixture::TestTxWithBigBlobs(const TTestTxWithBigBlobsParams& params)
1654
1657
start += oldHeadMsgCount;
1655
1658
1656
1659
for (size_t i = 0 ; i < bigBlobMsgCount; ++i) {
1657
- UNIT_ASSERT_VALUES_EQUAL (messages[start + i].size (), 7'900 '000 );
1660
+ UNIT_ASSERT_VALUES_EQUAL (messages[start + i].size (), 7'000 '000 );
1658
1661
}
1659
1662
start += bigBlobMsgCount;
1660
1663
@@ -1921,6 +1924,90 @@ Y_UNIT_TEST_F(WriteToTopic_Demo_28, TFixture)
1921
1924
UNIT_ASSERT_VALUES_EQUAL (messages.size (), 2 );
1922
1925
}
1923
1926
1927
+ void TFixture::WriteMessagesInTx (size_t big, size_t small)
1928
+ {
1929
+ CreateTopic (" topic_A" , TEST_CONSUMER);
1930
+
1931
+ NTable::TSession tableSession = CreateTableSession ();
1932
+ NTable::TTransaction tx = BeginTx (tableSession);
1933
+
1934
+ for (size_t i = 0 ; i < big; ++i) {
1935
+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (7'000'000 , ' x' ), &tx, 0 );
1936
+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1937
+ }
1938
+
1939
+ for (size_t i = 0 ; i < small; ++i) {
1940
+ WriteToTopic (" topic_A" , TEST_MESSAGE_GROUP_ID, TString (16'384 , ' x' ), &tx, 0 );
1941
+ WaitForAcks (" topic_A" , TEST_MESSAGE_GROUP_ID);
1942
+ }
1943
+
1944
+ CommitTx (tx, EStatus::SUCCESS);
1945
+ }
1946
+
1947
+ Y_UNIT_TEST_F (WriteToTopic_Demo_29, TFixture)
1948
+ {
1949
+ WriteMessagesInTx (1 , 0 );
1950
+ WriteMessagesInTx (1 , 0 );
1951
+ }
1952
+
1953
+ Y_UNIT_TEST_F (WriteToTopic_Demo_30, TFixture)
1954
+ {
1955
+ WriteMessagesInTx (1 , 0 );
1956
+ WriteMessagesInTx (0 , 1 );
1957
+ }
1958
+
1959
+ Y_UNIT_TEST_F (WriteToTopic_Demo_31, TFixture)
1960
+ {
1961
+ WriteMessagesInTx (1 , 0 );
1962
+ WriteMessagesInTx (1 , 1 );
1963
+ }
1964
+
1965
+ Y_UNIT_TEST_F (WriteToTopic_Demo_32, TFixture)
1966
+ {
1967
+ WriteMessagesInTx (0 , 1 );
1968
+ WriteMessagesInTx (1 , 0 );
1969
+ }
1970
+
1971
+ Y_UNIT_TEST_F (WriteToTopic_Demo_33, TFixture)
1972
+ {
1973
+ WriteMessagesInTx (0 , 1 );
1974
+ WriteMessagesInTx (0 , 1 );
1975
+ }
1976
+
1977
+ Y_UNIT_TEST_F (WriteToTopic_Demo_34, TFixture)
1978
+ {
1979
+ WriteMessagesInTx (0 , 1 );
1980
+ WriteMessagesInTx (1 , 1 );
1981
+ }
1982
+
1983
+ Y_UNIT_TEST_F (WriteToTopic_Demo_35, TFixture)
1984
+ {
1985
+ WriteMessagesInTx (1 , 1 );
1986
+ WriteMessagesInTx (1 , 0 );
1987
+ }
1988
+
1989
+ Y_UNIT_TEST_F (WriteToTopic_Demo_36, TFixture)
1990
+ {
1991
+ WriteMessagesInTx (1 , 1 );
1992
+ WriteMessagesInTx (0 , 1 );
1993
+ }
1994
+
1995
+ Y_UNIT_TEST_F (WriteToTopic_Demo_37, TFixture)
1996
+ {
1997
+ WriteMessagesInTx (1 , 1 );
1998
+ WriteMessagesInTx (1 , 1 );
1999
+ }
2000
+
2001
+
2002
+ Y_UNIT_TEST_F (WriteToTopic_Demo_38, TFixture)
2003
+ {
2004
+ WriteMessagesInTx (2 , 202 );
2005
+ WriteMessagesInTx (2 , 200 );
2006
+ WriteMessagesInTx (0 , 1 );
2007
+ WriteMessagesInTx (4 , 0 );
2008
+ WriteMessagesInTx (0 , 1 );
2009
+ }
2010
+
1924
2011
}
1925
2012
1926
2013
}
0 commit comments