Skip to content
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

OrElseCursor doesn't properly support continuations #974

Closed
nschiefer opened this issue Jun 17, 2020 · 0 comments
Closed

OrElseCursor doesn't properly support continuations #974

nschiefer opened this issue Jun 17, 2020 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nschiefer
Copy link
Contributor

An OrElseCursor is built out of an "inner" cursor and and an "else" cursor. If the inner cursor is non-empty, it returns values from the inner cursor; otherwise, it returns the values from the else cursor.

Currently, the OrElseCursor uses pass-through style continuation handling. However, this loses information (specifically: which branch the cursor is using). As a result, if the cursor chooses the else branch, there is no way to continue the cursor's operation.

To resolve this, we probably need to give OrElseCursor a structured protobuf continuation, like FlatMapPipelinedCursor.

@nschiefer nschiefer self-assigned this Jun 17, 2020
@nschiefer nschiefer added this to the 2.9 milestone Jun 17, 2020
@nschiefer nschiefer added the bug Something isn't working label Jun 17, 2020
nschiefer added a commit to nschiefer/fdb-record-layer that referenced this issue Jun 17, 2020
…ations.

Use a new structured continuation object and protobuf serialization to
record the complete state of the OrElseCursor, including which branch
was chosen. Rewrite OrElseCursor's logic in a simpler state-machine
style, which makes it easy to resume the cursor before it has made a
decision about which branch to take.

To avoid problems like we saw with the FlatMapPipelinedCursor's
continuations, deprecate the RecordCursor.orElse() fluent method and
replace it with a static method that interprets the continuation.

Because this changes the continuation format, this is a breaking change.
alecgrieser added a commit that referenced this issue Jun 17, 2020
Fixes #974: OrElseCursor doesn't properly support continuations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant