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

refactor: no-ticket: make DeferredColumnRegionBase more efficient wrt volatile #6574

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devinrsmith
Copy link
Member

No description provided.

@devinrsmith devinrsmith added this to the 0.38.0 milestone Jan 17, 2025
@devinrsmith devinrsmith self-assigned this Jan 17, 2025
@devinrsmith devinrsmith requested review from malhotrashivam and cpwright and removed request for malhotrashivam January 17, 2025 18:19
@devinrsmith devinrsmith enabled auto-merge (squash) January 17, 2025 22:00
@devinrsmith devinrsmith changed the title refactor: make DeferredColumnRegionBase more efficient wrt volatile refactor: no-ticket: make DeferredColumnRegionBase more efficient wrt volatile Jan 30, 2025
@@ -33,39 +32,33 @@ public abstract class DeferredColumnRegionBase<ATTR extends Any, REGION_TYPE ext
public void invalidate() {
super.invalidate();
synchronized (this) {
if (resultRegion != null) {
resultRegion.invalidate();
REGION_TYPE localResultRegion;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this case actually needs a lock as written. But maybe we should keep is this way and null out the result region after invalidating?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about this.

  • Keeping a non-null, invalidated result in place makes the invalidation sticky.
  • getResultRegion() isn't checking if we're invalidated, so if we were to null out the result we might create a new one. But that could also happen if invalidate() were to be called before the first call to getResultRegion().

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't try to dig any deeper into the intentions. As my PR stands, it's a pure refactor that preserves the existing behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants