@@ -1538,6 +1538,35 @@ int GetCumulativeCounterValue(Tests::TServer& server, const TString& path, const
1538
1538
return result;
1539
1539
}
1540
1540
1541
+ void CheckTableReads (NYdb::NTable::TSession& session, const TString& tableName, bool checkFollower, bool readsExpected) {
1542
+ for (size_t attempt = 0 ; attempt < 30 ; ++attempt)
1543
+ {
1544
+ Cerr << " ... SELECT from partition_stats for " << tableName << " , attempt " << attempt << Endl;
1545
+
1546
+ const TString selectPartitionStats (Q_ (Sprintf (R"(
1547
+ SELECT *
1548
+ FROM `/Root/.sys/partition_stats`
1549
+ WHERE FollowerId %s 0 AND (RowReads != 0 OR RangeReadRows != 0) AND Path = '%s'
1550
+ )" , (checkFollower ? " !=" : " =" ), tableName.c_str ())));
1551
+
1552
+ auto result = session.ExecuteDataQuery (selectPartitionStats, TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
1553
+ AssertSuccessResult (result);
1554
+ Cerr << selectPartitionStats << Endl;
1555
+
1556
+ auto rs = result.GetResultSet (0 );
1557
+ if (readsExpected) {
1558
+ if (rs.RowsCount () != 0 )
1559
+ return ;
1560
+ Sleep (TDuration::Seconds (5 ));
1561
+ } else {
1562
+ if (rs.RowsCount () == 0 )
1563
+ return ;
1564
+ Y_FAIL (" !readsExpected, but there are read stats for %s" , tableName.c_str ());
1565
+ }
1566
+ }
1567
+ Y_FAIL (" readsExpected, but there is timeout waiting for read stats from %s" , tableName.c_str ());
1568
+ }
1569
+
1541
1570
NJson::TJsonValue SimplifyPlan (NJson::TJsonValue& opt, const TGetPlanParams& params) {
1542
1571
if (auto ops = opt.GetMapSafe ().find (" Operators" ); ops != opt.GetMapSafe ().end ()) {
1543
1572
auto opName = ops->second .GetArraySafe ()[0 ].GetMapSafe ().at (" Name" ).GetStringSafe ();
0 commit comments