Skip to content

Serialize missing field createDefaultIfEmpty into streaming aggregate plan continuations #3211

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

Conversation

alecgrieser
Copy link
Collaborator

There is missing state that was introduced to the AggregateCursor and its accompanying plan in #3092. However, this state was not added to the continuation, which results in unexpected behavior when we try to deserialize the plan's continuation (effectively, it reverts to the old behavior of the plan operator). We were already correctly _de_serializing this information, so the upshot is that any plan that is started after this current version should exhibit the correct behavior, but we get incorrect behavior when a plan is started on an older version.

This fixes #3096. I was able to get test coverage of this part of the code by enabling FORCE_CONTINUATIONS mode on aggregateIndexTests.

…te plan continuations

There is missing state that was introduced to the `AggregateCursor` and its accompanying plan in FoundationDB#3092. However, this state was not added to the continuation, which results in unexpected behavior when we try to deserialize the plan's continuation (effectively, it reverts to the old behavior of the plan operator). We were already correctly _de_serializing this information, so the upshot is that any plan that is started after this current version should exhibit the correct behavior, but we get incorrect behavior when a plan is started on an older version.

This fixes FoundationDB#3096.
@alecgrieser alecgrieser added the bug fix Change that fixes a bug label Feb 28, 2025
@alecgrieser alecgrieser merged commit ff55294 into FoundationDB:main Feb 28, 2025
6 checks passed
@alecgrieser alecgrieser deleted the 03096-serialize-create-if-empty branch February 28, 2025 14:46
alecgrieser added a commit to alecgrieser/fdb-record-layer that referenced this pull request Mar 13, 2025
…tion deserialization

This cleans up the `StreamingAggregateCursor` and its helper classes to remove the `createDefaultIfEmpty` option. We'd been carrying that option around as we introduced that field in FoundationDB#3092 and wanted to preserve behavior when upgrading from older versions. The intention had been that all new plans would set the option starting in 4.1, but a bug (fixed in FoundationDB#3211; see FoundationDB#3096) means that we didn't actually enable it until 4.1.9.0. That means that after this change, we'd require 4.1.9.0 or newer in order to safely continue these queries. In theory, we could wait with this change, but 4.1.9.0 has enough fixes that I actually think our recommendation should be that anyone upgrading from 4.0 or below go straight to 4.1.9.0, and then they can proceed safely to a newer version with this change.

I was able to validate that this change is compatible with 4.1.9.0 via the cross-version tests run during PRB. When I ran the full mixed mode tests with the `aggregate-index-tests.yamsql`, I found that only 4.1.9.0 worked, which is expected.

This resolves FoundationDB#3092.
alecgrieser added a commit that referenced this pull request Apr 16, 2025
…tion deserialization (#3246)

This cleans up the `StreamingAggregateCursor` and its helper classes to
remove the `createDefaultIfEmpty` option. We'd been carrying that option
around as we introduced that field in #3092 and wanted to preserve
behavior when upgrading from older versions. The intention had been that
all new plans would set the option starting in 4.1, but a bug (fixed in
#3211; see #3096) means that we didn't actually enable it until 4.1.9.0.
That means that after this change, we'd require 4.1.9.0 or newer in
order to safely continue these queries. In theory, we could wait with
this change, but 4.1.9.0 has enough fixes that I actually think our
recommendation should be that anyone upgrading from 4.0 or below go
straight to 4.1.9.0, and then they can proceed safely to a newer version
with this change.

I was able to validate that this change is compatible with 4.1.9.0 via
the cross-version tests run during PRB. When I ran the full mixed mode
tests with the `aggregate-index-tests.yamsql`, I found that only 4.1.9.0
worked, which is expected.

This resolves #3107.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Change that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite continuations: sum(*) returns alternating rows forever
2 participants