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

Add Location removal support and update SourcePartitionedTable #4373

Merged
merged 28 commits into from
Sep 8, 2023

Conversation

abaranec
Copy link
Contributor

This fixes #4372 and #3077.

@abaranec abaranec requested review from rcaudy and cpwright August 24, 2023 21:36
@abaranec abaranec added this to the August 2023 milestone Aug 24, 2023

@Override
public boolean recordedVariablesAreValid() {
return error == null && super.recordedVariablesAreValid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to fix this check in MergedListener to use the recordedVariablesAreValid instead?

            for (ListenerRecorder recorder : recorders) {
                if (recorder.getNotificationStep() == currentStep) {
                    added += recorder.getAdded().size();
                    removed += recorder.getRemoved().size();
                    modified += recorder.getModified().size();
                    shifted += recorder.getShifted().getEffectiveSize();
                }
            }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the recorder will return empty everytthing when recorded values are not valid. That's why I did it that way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A table cannot double-notify. Those fields have to be empty. I don't think override to recordedVariablesAreValid is necessary or advisable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source table may not double notify. In the case that the source table of the ListenerRecorder notifies us of an error, we should correctly set the notification step and record the error - the listener did have a notification on that step. Given that there is an error there will never again be a valid notification from that source table.

The update in this case is going to be null; and if we ask the question "did this get updated on the current step" and then fetch and dereference the null update as is done on line 319-326 of MergedListener we have an error. The change to the recordedVariablesAreValid (which is just asking about the step) means that we get the appropriate empty update in this section of the MergedListener.

@cpwright
Copy link
Contributor

I am satisfied with this code. @rcaudy can you please assign a Community team member to review it?

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fundamentally flawed. You will not be able to properly handle previous data from the removed table location when processing a remove, which makes this entire effort kind of moot.

I think there's utility in adding proper removal propagation, if it's corrected to not be part of the interface.

@rcaudy
Copy link
Member

rcaudy commented Sep 5, 2023

Since the implementations of removal are out of scope for this PR (and for core at this time), I think we can rehabilitate the PR if we ensure that the removeTableLocation JavaDoc clearly states that implementations must provide certain guarantees:
Reads should only succeed against removed locations if they will return complete, correct, consistent data. Otherwise, they should fail with a meaningful error message.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • In the buffer:
    ** If you see a remove: if there’s a pending add, delete it, and ignore the remove
  • In consumers of the buffer:
    ** Always process removes before adds

columnChunkPageStore.fillChunkAppend(context, destination, rowSequenceIterator);
}

@Override
public final ChunkPage<ATTR> getChunkPageContaining(final long elementIndex) {
throwIfPoisioned();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are more aggressive than we need to be. We can absolutely read from cached pages. We cannot read new pages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we agreed to stay aggressive between @rcaudy @cpwright and @abaranec

…ces/regioned/GenericColumnRegionBase.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
@rcaudy rcaudy enabled auto-merge (squash) September 8, 2023 21:02
@rcaudy rcaudy merged commit 6e8a740 into deephaven:main Sep 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update SourcePartitionedTable to handle location removal
3 participants