@@ -718,9 +718,10 @@ Y_UNIT_TEST_TWIN(OneShardLocalExec, UseSink) {
718
718
UNIT_ASSERT_VALUES_EQUAL (counters.NonLocalSingleNodeReqCount ->Val (), 0 );
719
719
}
720
720
721
- Y_UNIT_TEST_TWIN (OneShardNonLocalExec, UseSink) {
721
+ Y_UNIT_TEST_QUAD (OneShardNonLocalExec, UseSink, EnableParallelPointReadConsolidation ) {
722
722
NKikimrConfig::TAppConfig app;
723
723
app.MutableTableServiceConfig ()->SetEnableOltpSink (UseSink);
724
+ app.MutableTableServiceConfig ()->SetEnableParallelPointReadConsolidation (EnableParallelPointReadConsolidation);
724
725
TKikimrRunner kikimr (TKikimrSettings ().SetNodeCount (2 ).SetAppConfig (app));
725
726
auto db = kikimr.GetTableClient ();
726
727
auto session = db.CreateSession ().GetValueSync ().GetSession ();
@@ -791,89 +792,50 @@ Y_UNIT_TEST_TWIN(OneShardNonLocalExec, UseSink) {
791
792
)" , TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
792
793
UNIT_ASSERT (result.IsSuccess ());
793
794
794
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
795
- // Session is on node 1, read task is for node 2 -> TotalSingleNodeReqCount does not increase
796
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount);
797
- } else {
798
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
799
- }
795
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
800
796
}
801
797
{
802
798
auto result = session.ExecuteDataQuery (R"(
803
799
UPSERT INTO `/Root/EightShard` (Key, Data) VALUES (1, 1);
804
800
)" , TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
805
801
UNIT_ASSERT (result.IsSuccess ());
806
802
807
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
808
- // If UseSink is enabled, compute is on node 1, write is on node 2 -> TotalSingleNodeReqCount does not increase
809
- // If UseSink is disabled, the execution is on node 2 -> TotalSingleNodeReqCount increases
810
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount += (UseSink) ? 0 : 1 );
811
- } else {
812
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
813
- }
803
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
814
804
}
815
805
{
816
806
auto result = kikimr.GetQueryClient ().ExecuteQuery (R"(
817
807
SELECT * FROM `/Root/EightShard` WHERE Key = 1;
818
808
)" , NYdb::NQuery::TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
819
809
UNIT_ASSERT (result.IsSuccess ());
820
810
821
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
822
- // Session is on node 1, read task is for node 2 -> TotalSingleNodeReqCount does not increase
823
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount);
824
- } else {
825
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
826
- }
811
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
827
812
}
828
813
{
829
814
auto result = kikimr.GetQueryClient ().ExecuteQuery (R"(
830
815
UPSERT INTO `/Root/EightShard` (Key, Data) VALUES (1, 1);
831
816
)" , NYdb::NQuery::TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
832
817
UNIT_ASSERT (result.IsSuccess ());
833
818
834
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
835
- // If UseSink is enabled, compute is on node 1, write is on node 2 -> TotalSingleNodeReqCount does not increase
836
- // If UseSink is disabled, the execution is on node 2 -> TotalSingleNodeReqCount increases
837
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount += (UseSink) ? 0 : 1 );
838
- } else {
839
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
840
- }
819
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
841
820
}
842
821
{
843
822
auto result = session.ExecuteDataQuery (R"(
844
823
UPDATE `/Root/EightShard` SET Data = 111 WHERE Key = 1;
845
824
)" , TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
846
825
UNIT_ASSERT (result.IsSuccess ());
847
826
848
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
849
- // Read is on node 1, write is on node 2 -> TotalSingleNodeReqCount does not increase
850
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount);
851
- } else {
852
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
853
- }
827
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
854
828
}
855
829
{
856
830
auto result = kikimr.GetQueryClient ().ExecuteQuery (R"(
857
831
UPDATE `/Root/EightShard` SET Data = 111 WHERE Key = 1;
858
832
)" , NYdb::NQuery::TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
859
833
UNIT_ASSERT (result.IsSuccess ());
860
834
861
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
862
- // Read is on node 1, write is on node 2 -> TotalSingleNodeReqCount does not increase
863
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), expectedTotalSingleNodeReqCount);
864
- } else {
865
- UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
866
- }
867
- }
868
-
869
- if (app.GetTableServiceConfig ().GetEnableParallelPointReadConsolidation ()) {
870
- // If UseSink is enabled, all requests are local or with two nodes -> NonLocalSingleNodeReqCount does not increase
871
- // If UseSink is disabled, UPSERT queries are non-local and for the single node -> NonLocalSingleNodeReqCount increases
872
- expectedNonLocalSingleNodeReqCount += (UseSink) ? 0 : 2 ;
873
- } else {
874
- expectedNonLocalSingleNodeReqCount += 6 ;
835
+ UNIT_ASSERT_VALUES_EQUAL (counters.TotalSingleNodeReqCount ->Val (), ++expectedTotalSingleNodeReqCount);
875
836
}
876
837
838
+ expectedNonLocalSingleNodeReqCount += 6 ;
877
839
UNIT_ASSERT_VALUES_EQUAL (counters.NonLocalSingleNodeReqCount ->Val (), expectedNonLocalSingleNodeReqCount);
878
840
879
841
// Now resume node 1 and move all tablets on the node1
0 commit comments