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

changefeedccl: add more logging of spans during DistSQL planning #119549

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

andyyang890
Copy link
Collaborator

@andyyang890 andyyang890 commented Feb 22, 2024

This patch adds more logging of spans during various stages of DistSQL
planning to help with debugging plans with erroneous spans.

Epic: None

Release note: None

@andyyang890 andyyang890 requested a review from a team as a code owner February 22, 2024 22:11
@blathers-crl blathers-crl bot added the backport Label PR's that are backports to older release branches label Feb 22, 2024
Copy link

blathers-crl bot commented Feb 22, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rharding6373
Copy link
Collaborator

Would it make sense to open a PR with the extra logging on master and then backport it to 23.1 and 23.2? It seems potentially useful for more than just the 23.1 release.

@andyyang890 andyyang890 force-pushed the changefeed_rebalance_logging branch from 2bab53b to 4700595 Compare February 22, 2024 22:58
@andyyang890 andyyang890 requested a review from a team February 22, 2024 22:58
@andyyang890 andyyang890 requested review from a team as code owners February 22, 2024 22:58
@andyyang890 andyyang890 requested a review from a team February 22, 2024 22:58
@andyyang890 andyyang890 requested review from a team as code owners February 22, 2024 22:58
@andyyang890 andyyang890 requested a review from a team February 22, 2024 22:58
@andyyang890 andyyang890 requested review from a team as code owners February 22, 2024 22:58
@andyyang890 andyyang890 removed the request for review from a team February 22, 2024 22:58
@andyyang890 andyyang890 removed the backport Label PR's that are backports to older release branches label Feb 22, 2024
@cockroachdb cockroachdb deleted a comment from blathers-crl bot Feb 22, 2024
@andyyang890 andyyang890 changed the title release-23.1: changefeedccl: add logging of spans before and after rebalancing changefeedccl: add more logging of spans during DistSQL planning Feb 22, 2024
@cockroachdb cockroachdb deleted a comment from blathers-crl bot Feb 22, 2024
Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm: I only have a couple minor nits. Thanks for adding more observability!

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


pkg/ccl/changefeedccl/changefeed_dist.go line 399 at r1 (raw file):

		case rangeDistribution == int64(balancedSimpleDistribution):
			if log.ExpensiveLogEnabled(ctx, 2) {
				log.Infof(ctx, "attempt to rebalance ranges using balanced simple distribution")

minor nit: s/attempt to rebalance/rebalancing


pkg/ccl/changefeedccl/changefeed_dist.go line 443 at r1 (raw file):

		for i, sp := range spanPartitions {
			if log.ExpensiveLogEnabled(ctx, 2) {
				log.Infof(ctx, "watched spans for node %d: %s", sp.SQLInstanceID, sp)

This log seems redundant with the previous one. Do you think we need both? I would favor keeping this log in favor of the previous one.

This patch adds more logging of spans during various stages of DistSQL
planning to help with debugging plans with erroneous spans.

Release note: None
@andyyang890 andyyang890 force-pushed the changefeed_rebalance_logging branch from 4700595 to ad4e8f0 Compare February 23, 2024 20:23
Copy link
Collaborator Author

@andyyang890 andyyang890 left a comment

Choose a reason for hiding this comment

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

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


pkg/ccl/changefeedccl/changefeed_dist.go line 399 at r1 (raw file):

Previously, rharding6373 (Rachael Harding) wrote…

minor nit: s/attempt to rebalance/rebalancing

Done.


pkg/ccl/changefeedccl/changefeed_dist.go line 443 at r1 (raw file):

Previously, rharding6373 (Rachael Harding) wrote…

This log seems redundant with the previous one. Do you think we need both? I would favor keeping this log in favor of the previous one.

I think it could still be useful to have both log messages so that we know the spans right after rebalancing (previous log) and the spans right before we pass them to the processors (this log). This way if there are any other immediate transformations, we'll be able to conclusively tell whether rebalancing messed up the spans and/or whether the final spans we're giving to the processors are right. Thoughts?

@andyyang890 andyyang890 added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. labels Feb 23, 2024
Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/ccl/changefeedccl/changefeed_dist.go line 443 at r1 (raw file):

Previously, andyyang890 (Andy Yang) wrote…

I think it could still be useful to have both log messages so that we know the spans right after rebalancing (previous log) and the spans right before we pass them to the processors (this log). This way if there are any other immediate transformations, we'll be able to conclusively tell whether rebalancing messed up the spans and/or whether the final spans we're giving to the processors are right. Thoughts?

Ah, didn't see where they could be modified in between. Seems ok as is.

@andyyang890
Copy link
Collaborator Author

TFTR!

bors r=rharding6373

@craig
Copy link
Contributor

craig bot commented Feb 24, 2024

Build succeeded:

@craig craig bot merged commit cd723f0 into cockroachdb:master Feb 24, 2024
13 of 15 checks passed
Copy link

blathers-crl bot commented Feb 24, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from ad4e8f0 to blathers/backport-release-23.1-119549: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


error creating merge commit from ad4e8f0 to blathers/backport-release-23.2-119549: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants