Skip to content

Enable force continuations mode on all YamlIntegrationTests #3228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 69 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0c6b9fa
Create a sandbox with all tests enabled, running with current vs. 4.0…
ohadzeliger Feb 20, 2025
6f83adf
Add triage comments to bitmap-aggregate-index tests
ohadzeliger Feb 20, 2025
09c7dcf
Remove exclusion and added triage comments to join-tests, select-a-st…
ohadzeliger Feb 20, 2025
dcd5e74
Merge branch 'main' into 4.1-status-DO-NOT-MERGE
ohadzeliger Feb 21, 2025
1bfc0fe
Mark 4.1 Triage tests for aggregate-empty-table
ohadzeliger Feb 21, 2025
f4d2502
Add 4.1 triage annotations to groupby-tests
ohadzeliger Feb 21, 2025
d5b685e
Add 4.1 triage annotations to standard-tests.yamsql
ohadzeliger Feb 24, 2025
b0e463a
Add 4.1 triage annotations to standard-tests-proto.yamsql
ohadzeliger Feb 24, 2025
7be0ce3
Add 4.1 triage annotations to field-index-tests-proto.yamsql
ohadzeliger Feb 24, 2025
10fc852
Add 4.1 triage annotations to standard-tests-metadata.yamsql
ohadzeliger Feb 24, 2025
36af5b7
Add 4.1 triage annotations to null-operator-tests.yamsql
ohadzeliger Feb 24, 2025
b9992f2
Add 4.1 triage annotations to inserts-updates-deletes.yamsql
ohadzeliger Feb 24, 2025
ac88dcd
Add 4.1 triage annotations to aggregate-index-tests.yamsql
ohadzeliger Feb 24, 2025
db9dedf
Add 4.1 triage annotations to aggregate-index-tests-count.yamsql.yamsql
ohadzeliger Feb 24, 2025
7593e96
Add 4.1 triage annotations to aggregate-index-tests-count-empty.yamsq…
ohadzeliger Feb 24, 2025
ff20e75
Add 4.1 triage annotations to primary-key-tests.yamsql
ohadzeliger Feb 24, 2025
85b263e
Add 4.1 triage annotations to boolean.yamsql
ohadzeliger Feb 24, 2025
c303d46
Add 4.1 triage annotations to catalog.yamsql
ohadzeliger Feb 24, 2025
1d2da88
Disable forced continuations for updateDeleteReturning
ohadzeliger Feb 24, 2025
ac8205e
4.1-triage annotations to enum.yamsql
ScottDugas Feb 24, 2025
31f1e0b
4.1-triage annotations to insert-enum.yamsql
ScottDugas Feb 24, 2025
fd9c281
4.1-triage annotations to like.yamsql
ScottDugas Feb 24, 2025
aecd1e2
4.1-triage annotations to create-drop.yamsql
ScottDugas Feb 24, 2025
ecb4d3a
4.1-triage annotations to functions.yamsql
ScottDugas Feb 24, 2025
e4b9626
annotate recursive-cte.yamsql
ohadzeliger Feb 24, 2025
fc09ed9
Merge branch 'main' into 4.1-status-DO-NOT-MERGE
ohadzeliger Feb 25, 2025
c1fa486
Triage:
ohadzeliger Feb 26, 2025
d0d9c56
Change wording
ohadzeliger Feb 26, 2025
06f4606
Triage rest of files, add to annotations
ohadzeliger Feb 26, 2025
11494c3
Squashed commit of the following:
alecgrieser Feb 27, 2025
f2fbc50
fix up aggregate-index-tests-count-empty.yamsql to work better in mix…
alecgrieser Feb 27, 2025
3b3f341
update aggregate-empty-table.yamql to handle 4.1 changes
alecgrieser Feb 28, 2025
12693c0
Fixes #3096: Infinite continuations: sum(*) returns alternating rows …
alecgrieser Feb 28, 2025
d84afe1
Fix continuation deserialization errors by deserializing streaming ag…
alecgrieser Feb 28, 2025
0e043b4
fix up groupby-tests.yamsql which were mostly failing with verify exc…
alecgrieser Feb 28, 2025
fee4bbf
Merge remote-tracking branch 'upstream/main' into enable-force-contin…
alecgrieser Feb 28, 2025
e55da51
fix up groupby-tests.yamsql to allow for force_continuations
alecgrieser Mar 3, 2025
c37b95a
fix up boolean.yamsql to enable force_continuations on most queries
alecgrieser Mar 3, 2025
3848f0a
`EXISTS` queries now honor continuation from previous runs to avoid i…
alecgrieser Mar 3, 2025
ad17b13
fixup subquery-tests.yamsql to enable more force continuations tests
alecgrieser Mar 3, 2025
51c816b
touch up bitmap-aggregate-index.yamsql
alecgrieser Mar 3, 2025
a194aac
include issues in functions.yamsql
alecgrieser Mar 3, 2025
5465ee2
Merge remote-tracking branch 'upstream/main' into enable-force-contin…
alecgrieser Mar 4, 2025
d6a54b5
update catalog.yamsql
alecgrieser Mar 4, 2025
8d73c93
fix up standard-tests-proto.yamsql to allow force_continuations on it
alecgrieser Mar 4, 2025
e967f67
fix up standard-tests.yamsql
alecgrieser Mar 4, 2025
9b41439
require !current_version on create-drop.yamsql
alecgrieser Mar 4, 2025
d2004d4
update field-index-tests-proto.yamsql to allow for force continuation…
alecgrieser Mar 4, 2025
601ec19
update inserts-updates-deletes.yamsql to account for new error messages
alecgrieser Mar 4, 2025
571bda6
fixup null-operator-tests.yamsql
alecgrieser Mar 4, 2025
60f8955
fixup primary-key-tests.yamsql
alecgrieser Mar 4, 2025
6917a86
remove 4.1 triage from null-operator-tests.yamsql
alecgrieser Mar 4, 2025
db5c326
fixup standard-tests-metadata.yamsql
alecgrieser Mar 4, 2025
7afba2b
fixup union.yamsql though it is still a bit rough
alecgrieser Mar 4, 2025
c331d8a
update union-empty-tables.yamsql and like.yamsql
alecgrieser Mar 4, 2025
e971ee8
Squashed commit of the following:
alecgrieser Mar 4, 2025
eab7398
tidy up a few test yamsqls
alecgrieser Mar 5, 2025
0e29270
Merge remote-tracking branch 'upstream/main' into enable-force-contin…
alecgrieser Mar 5, 2025
62d8e2a
remove file also deleted on main
alecgrieser Mar 5, 2025
c68d72b
fix style error
alecgrieser Mar 5, 2025
69cb4f4
pull latest release for external server instead of 4.0.559.6
alecgrieser Mar 5, 2025
50d83e4
revert change that was only necessary to support ForceContinuations(E…
alecgrieser Mar 5, 2025
1f21ecc
Merge remote-tracking branch 'upstream/main' into enable-force-contin…
alecgrieser Mar 6, 2025
18fa01e
Merge remote-tracking branch 'upstream/main' into enable-force-contin…
alecgrieser Mar 6, 2025
6cbe672
add logging when ignoring beginning continuation chekc
alecgrieser Mar 6, 2025
c81c23c
update aggregate-empty-table.yamsql
alecgrieser Mar 6, 2025
d0a3b74
update YAML in response to comments
alecgrieser Mar 6, 2025
01a1c06
Remove single_repetition_ordered
alecgrieser Mar 7, 2025
d708c2d
fix error and add uplevel test for one union.yamsql query
alecgrieser Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
import com.apple.foundationdb.relational.api.RelationalResultSetMetaData;
import com.apple.foundationdb.relational.api.exceptions.RelationalException;
import com.apple.foundationdb.relational.api.metrics.RelationalMetric;
import com.apple.foundationdb.relational.recordlayer.ContinuationImpl;
import com.apple.foundationdb.relational.yamltests.AggregateResultSet;
import com.apple.foundationdb.relational.yamltests.YamlConnection;
import com.apple.foundationdb.relational.yamltests.command.parameterinjection.Parameter;
import com.apple.foundationdb.relational.yamltests.server.SemanticVersion;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Assertions;
Expand All @@ -53,6 +55,8 @@ public class QueryExecutor {
private static final Logger logger = LogManager.getLogger(QueryExecutor.class);
private static final int FORCED_MAX_ROWS = 1; // The maxRows number to use when we are forcing it on the test
private static final int MAX_CONTINUATIONS_ALLOWED = 100;
@SuppressWarnings("PMD.AvoidUsingHardCodedIP") // This is not an IP address
private static final SemanticVersion STRICT_ASSERTIONS_CUTOFF = SemanticVersion.parse("4.1.9.0");

@Nonnull
private final String query;
Expand Down Expand Up @@ -107,8 +111,10 @@ public Continuation execute(@Nonnull YamlConnection connection, @Nullable Contin
return executeQuery(connection, config, currentQuery, checkCache, maxRows);
} else if (continuation.atBeginning()) {
// Continuation cannot be at beginning if it was returned from a query
reportTestFailure("Received continuation shouldn't be at beginning");
return null;
if (STRICT_ASSERTIONS_CUTOFF.lesserVersions(connection.getVersions()).isEmpty()) {
reportTestFailure("Received continuation shouldn't be at beginning");
}
return ContinuationImpl.END;
} else {
// Have a continuation - continue
return executeContinuation(connection, continuation, config, currentQuery, maxRows);
Expand Down Expand Up @@ -143,7 +149,7 @@ private Object executeStatementAndCheckCacheIfNeeded(@Nonnull Statement s, final
final var toReturn = executeStatementAndCheckForceContinuations(s, statementHasQuery, queryString, connection, maxRows);
final var postMetricCollector = connection.getMetricCollector();
final var postValue = postMetricCollector.hasCounter(RelationalMetric.RelationalCount.PLAN_CACHE_TERTIARY_HIT) ?
postMetricCollector.getCountsForCounter(RelationalMetric.RelationalCount.PLAN_CACHE_TERTIARY_HIT) : 0;
postMetricCollector.getCountsForCounter(RelationalMetric.RelationalCount.PLAN_CACHE_TERTIARY_HIT) : 0;
final var planFound = preMetricCollector != postMetricCollector ? postValue == 1 : postValue == preValue + 1;
if (!planFound) {
reportTestFailure("‼️ Expected to retrieve the plan from the cache at line " + lineNumber);
Expand Down Expand Up @@ -263,7 +269,11 @@ private Object executeStatementWithForcedContinuations(final @Nonnull Statement
int count = 0;
while (!continuation.atEnd()) {
if (continuation.atBeginning()) {
reportTestFailure("Received continuation shouldn't be at beginning");
if (STRICT_ASSERTIONS_CUTOFF.lesserVersions(connection.getVersions()).isEmpty()) {
reportTestFailure("Received continuation shouldn't be at beginning");
}
continuation = ContinuationImpl.END;
break;
}
try (var s2 = prepareContinuationStatement(connection, continuation, FORCED_MAX_ROWS)) {
resultSet = (RelationalResultSet)executeStatement(s2, true, queryString);
Expand All @@ -273,7 +283,9 @@ private Object executeStatementWithForcedContinuations(final @Nonnull Statement
results.add(resultSet);
} else {
// We assume that the last result is empty because of the maxRows:1
Assertions.assertFalse(hasNext, "Result has more rows than maxRows allowed");
if (STRICT_ASSERTIONS_CUTOFF.lesserVersions(connection.getVersions()).isEmpty()) {
Assertions.assertFalse(hasNext, "End result should not have any associated value when maxRows is 1");
}
}
}
count += 1; // PMD failure for ++
Expand Down
27 changes: 0 additions & 27 deletions yaml-tests/src/test/java/YamlIntegrationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* limitations under the License.
*/

import com.apple.foundationdb.relational.yamltests.ExcludeYamlTestConfig;
import com.apple.foundationdb.relational.yamltests.MaintainYamlTestConfig;
import com.apple.foundationdb.relational.yamltests.YamlTest;
import com.apple.foundationdb.relational.yamltests.YamlTestConfigFilters;
Expand All @@ -39,43 +38,31 @@ public void showcasingTests(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Infinite continuation loop (https://github.com/FoundationDB/fdb-record-layer/issues/3095)")
public void groupByTests(YamlTest.Runner runner) throws Exception {
runner.runYamsql("groupby-tests.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
public void standardTests(YamlTest.Runner runner) throws Exception {
runner.runYamsql("standard-tests.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
public void standardTestsWithProto(YamlTest.Runner runner) throws Exception {
runner.runYamsql("standard-tests-proto.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
public void fieldIndexTestsProto(YamlTest.Runner runner) throws Exception {
runner.runYamsql("field-index-tests-proto.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
public void standardTestsWithMetaData(YamlTest.Runner runner) throws Exception {
runner.runYamsql("standard-tests-metadata.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
public void nullOperator(YamlTest.Runner runner) throws Exception {
runner.runYamsql("null-operator-tests.yamsql");
}
Expand All @@ -102,8 +89,6 @@ public void joinTests(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Infinite continuation loop (https://github.com/FoundationDB/fdb-record-layer/issues/3095)")
public void subqueryTests(YamlTest.Runner runner) throws Exception {
runner.runYamsql("subquery-tests.yamsql");
}
Expand All @@ -130,8 +115,6 @@ public void aggregateIndexTests(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Infinite continuation loop (https://github.com/FoundationDB/fdb-record-layer/issues/3095)")
public void aggregateEmptyTable(YamlTest.Runner runner) throws Exception {
runner.runYamsql("aggregate-empty-table.yamsql");
}
Expand Down Expand Up @@ -192,8 +175,6 @@ void bytes(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
void catalog(YamlTest.Runner runner) throws Exception {
runner.runYamsql("catalog.yamsql");
}
Expand All @@ -204,8 +185,6 @@ public void caseWhen(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "maxRows ignored on update (https://github.com/FoundationDB/fdb-record-layer/issues/3100)")
public void updateDeleteReturning(YamlTest.Runner runner) throws Exception {
runner.runYamsql("update-delete-returning.yamsql");
}
Expand All @@ -221,8 +200,6 @@ void functions(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Continuation verification (https://github.com/FoundationDB/fdb-record-layer/issues/3096)")
void createDrop(YamlTest.Runner runner) throws Exception {
runner.runYamsql("create-drop.yamsql");
}
Expand All @@ -248,15 +225,11 @@ public void indexedFunctions(YamlTest.Runner runner) throws Exception {
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Infinite continuation loop (https://github.com/FoundationDB/fdb-record-layer/issues/3095)")
public void union(YamlTest.Runner runner) throws Exception {
runner.runYamsql("union.yamsql");
}

@TestTemplate
@ExcludeYamlTestConfig(value = YamlTestConfigFilters.DO_NOT_FORCE_CONTINUATIONS,
reason = "Infinite continuation loop (https://github.com/FoundationDB/fdb-record-layer/issues/3095)")
public void unionEmptyTables(YamlTest.Runner runner) throws Exception {
runner.runYamsql("union-empty-tables.yamsql");
}
Expand Down
Loading