Fix issue where contexts were being notified before gnode state was updated #1136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a regression in gnode
_process_table
, which would notify contexts with a new update dataset before updating the master table maintained by the gnode state. This caused a problem with certain aggregates such as mean and avg, which read from gnode state.The problem emanates from a specific code path - a table is created with a schema, and a pivoted view with a mean/avg/etc. aggregate is created, and then update is called. If the table is not updated again/a new context is not created, the aggregate values return null as they have been notified with a stale version of the gnode state. In the viewer, it was easy to miss this bug - making any UI changes would create a fresh context, which would make the issue disappear as the contexts were re-synchronized to the latest gnode state.
weighted mean
aggregates