Skip to content

colflow: fix recent misuse of two slices in the flow setup#56597

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:fix-pooling
Nov 12, 2020
Merged

colflow: fix recent misuse of two slices in the flow setup#56597
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:fix-pooling

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

We've recently added the reusing of metadataSourcesQueue and toClose
slices in order to reduce some allocations. However, the components that
are using those slices don't make a deep copy, and as a result, we
introduced a bug in which we were breaking the current contract. This
commit fixes the issue by going back to the old method (with slight
difference in that we currently delay any allocations unlike previously
when we allocated a slice with capacity of 1).

Release note: None (no release with this bug)

We've recently added the reusing of metadataSourcesQueue and toClose
slices in order to reduce some allocations. However, the components that
are using those slices don't make a deep copy, and as a result, we
introduced a bug in which we were breaking the current contract. This
commit fixes the issue by going back to the old method (with slight
difference in that we currently delay any allocations unlike previously
when we allocated a slice with capacity of 1).

Release note: None (no release with this bug)
@yuzefovich yuzefovich requested review from a team and asubiotto November 12, 2020 04:23
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@yuzefovich
Copy link
Copy Markdown
Member Author

I noticed this while reviving #55909. There still is lurking some other issue due to reusing of the materializers which I don't quite understand yet, but I believe this PR fixes a true problem still.

Copy link
Copy Markdown
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

The other option is to change components that drain to copy the slice that is passed in to them to make it really lazy, but this also :lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto)

@yuzefovich
Copy link
Copy Markdown
Member Author

I like the current approach more since it centralizes where the decision to copy or not is made.

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 12, 2020

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 12, 2020

Build succeeded:

@craig craig bot merged commit a5e67b6 into cockroachdb:master Nov 12, 2020
@yuzefovich yuzefovich deleted the fix-pooling branch November 12, 2020 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants