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

colexecwindow: fix up some of the gcassert assertions #90820

Merged
merged 1 commit into from
Nov 8, 2022

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Oct 28, 2022

This commit removes some of the gcassert assertions that are actually
not true - here we use // gcassert as opposed to //gcassert, and
since we used the old gcassert version, they weren't actually enforced.

Additionally, this commit adjusts the code a bit in order to make the
assertions valid in some cases. One interesting change was to move the
slice accesses into PerformOperation which made BCEs to occur.

Epic: None

Release note: None

@yuzefovich yuzefovich requested review from DrewKimball and a team October 28, 2022 01:12
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

I'm trying to upgrade gcassert separately, in #90807.

Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

:lgtm: Just had a couple questions.

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


pkg/sql/colexec/colexecwindow/min_max_queue.go line 81 at r1 (raw file):

func (q *minMaxQueue) getLast() uint32 {
	if q.empty {
		colexecerror.InternalError(errors.AssertionFailedf("getting last from empty minMaxQueue"))

Why remove the assertion above but not this one? Does the method still not get inlined?


pkg/sql/colexec/colexecwindow/min_max_removable_agg_tmpl.go line 224 at r1 (raw file):

			} else {
				// {{if not .IsBytesLike}}
				// gcassert:bce

I'm a little surprised at this one - maybe the accesses have to go inside PerformOperation?

This commit removes some of the `gcassert` assertions that are actually
not true - here we use `// gcassert` as opposed to `//gcassert`, and
since we used the old gcassert version, they weren't actually enforced.

Additionally, this commit adjusts the code a bit in order to make the
assertions valid in some cases. One interesting change was to move the
slice accesses into `PerformOperation` which made BCEs to occur.

Release note: None
@yuzefovich yuzefovich changed the title colexecwindow: remove some assertions that aren't valid colexecwindow: fix up some of the gcassert assertions Nov 8, 2022
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r+

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


pkg/sql/colexec/colexecwindow/min_max_queue.go line 81 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

Why remove the assertion above but not this one? Does the method still not get inlined?

I guess I thought that get was more frequent than getLast. Removed the check and returned the inlined assertion.


pkg/sql/colexec/colexecwindow/min_max_removable_agg_tmpl.go line 224 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

I'm a little surprised at this one - maybe the accesses have to go inside PerformOperation?

That was it, thanks.

@craig
Copy link
Contributor

craig bot commented Nov 8, 2022

Build succeeded:

@craig craig bot merged commit 7891d96 into cockroachdb:master Nov 8, 2022
@yuzefovich yuzefovich deleted the gcassert-colexecwindow branch November 8, 2022 20:29
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