Jackie-Jiang commented on code in PR #20311:
URL: https://github.com/apache/pinot/pull/20311#discussion_r4650988555
##########
pinot-integration-test-base/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTest.java:
##########
@@ -980,6 +992,26 @@ protected long getCurrentCountStarResult(String tableName)
{
return 0;
}
+ /// Get current result for "SELECT COUNT(\*) ... OPTION(skipUpsert=true)":
every ingested row of an upsert or dedup
+ /// table, including the ones upsert replaced or deleted.
+ ///
+ /// @throws IllegalStateException when the broker returns an exception or no
result, since a count from part of the
+ /// segments is not the table's count
+ protected long getCurrentCountStarResultWithoutUpsert(String tableName) {
Review Comment:
[P1] Coordinate the protected helper with downstream subclasses
A downstream subclass of `UpsertTableSegmentPreloadIntegrationTest` already
declares `private long getCurrentCountStarResultWithoutUpsert(String
tableName)`. Adding this inherited protected method makes that subclass fail
compilation because its method has weaker access. The helper consolidation
needs a companion change to remove the downstream duplicate and use the
inherited helper, or widen the downstream method to protected. Please validate
downstream test compilation against this OSS head before updating its
dependency.
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseDedupIntegrationTest.java:
##########
@@ -217,51 +220,40 @@ protected long getCountStarResult() {
//Tests the query results for table with RF=1
@Test
- public void testValues() {
- assertEquals(getCurrentCountStarResult(), getCountStarResult());
-
- // Validate the older value persist
- for (int i = 0; i < getCountStarResult(); i++) {
- Assert.assertEquals(getPinotConnection()
- .execute("SELECT name FROM " + getTableName() + " WHERE id = " + i)
- .getResultSet(0)
- .getString(0),
- "" + i);
- }
+ public void testValues()
+ throws Exception {
+ assertRows(dedupRowsQuery(getTableName()), DEDUP_SURVIVORS);
}
@Test
public void testSegmentReload()
throws Exception {
- getOrCreateAdminClient().getSegmentClient().reloadTable(getTableName(),
null, false);
-
- // wait for reload to finish
- Thread.sleep(1000);
+ String reloadJobId = reloadTableAndValidateResponse(getTableName(),
TableType.REALTIME, false);
+ TestUtils.waitForCondition(aVoid -> {
+ try {
+ return isReloadJobCompleted(reloadJobId);
+ } catch (Exception e) {
+ return false;
+ }
+ }, 1000L, 600_000L, "Reload job " + reloadJobId + " did not finish");
- // Push data again
+ // Push data again. Dedup drops every re-pushed row, so wait until both
tables have consumed them before checking.
pushAvroIntoKafka(_avroFiles);
+ waitForAllStreamRecordsConsumed(getTableName(), 600_000L);
+ waitForAllStreamRecordsConsumed(DEDUP_TABLE_WITH_REPLICAS, 600_000L);
Review Comment:
[P2] Keep the replica-table reload checks optional for subclasses
A downstream subclass intentionally overrides
`createDedupTableWithReplicas()` with a no-op and disables
`testValuesWithReplicas()`, but still inherits/calls `testSegmentReload()`.
This new unconditional wait retries for 600,000 ms against a table that was
never created, then fails. The convergence wait at line 245 and replica
assertion at line 249 make the same assumption. Keep all three replica-table
operations in an overridable replica-specific path, or guard them using the
fixture configuration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]