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

sql: add old zone config in zone config logs #132677

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

annrpom
Copy link
Contributor

@annrpom annrpom commented Oct 15, 2024

This PR is stacked on top of another one!

Please consider reviewing that PR first. This message will be removed once the prerequisite PR is merged and this one is rebased.


sql: add old zone config in zone config logs

This patch adds another field in eventpb.SetZoneConfig.
This field, ResolvedOldConfig, will aid in logging the zone configuration
that we have changed.

We use the completeZone/completeSubzone here because we want to
be more useful in our zone config logging. The benefit of using the
complete* is that we can explicitly see what fields are changing,
even if they are actually modeled as a zone config that just inherits
from its parent. The disadvantage of this is that we are not able
to easily tell the inheritence of the old zone config, but knowing
the actual diff between the old vs new config seems more relevant
for debugging.

Fixes: #127176

Release note: None


schemachanger: log index, partition

This patch enables logging for index and partition
zone configs in the DSC.

Release note: None


schemachanger: add old zone config in zone config logs in DSC

This patch fills the ResolvedOldConfig field in
eventpb.SetZoneConfig to log the old zone configuration
in the declarative schema changer.

Informs: #127176

Release note: None

Copy link

blathers-crl bot commented Oct 15, 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

@annrpom annrpom force-pushed the zc-logging branch 3 times, most recently from 4c4a393 to 2e0e525 Compare October 16, 2024 15:00
@annrpom
Copy link
Contributor Author

annrpom commented Oct 16, 2024

Tests are failing because I need to update some side effects files from our end to end testing; I'll update before merge

@annrpom annrpom marked this pull request as ready for review October 16, 2024 15:34
@annrpom annrpom requested review from a team as code owners October 16, 2024 15:34
@annrpom annrpom requested review from angles-n-daemons, arjunmahishi and aa-joshi and removed request for a team October 16, 2024 15:34
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

nice work!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @aa-joshi, @angles-n-daemons, @annrpom, and @arjunmahishi)


pkg/ccl/logictestccl/testdata/logic_test/event_log line 0 at r1 (raw file):
do you know why this had to be in the ccl package?

Copy link
Contributor Author

@annrpom annrpom 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 (waiting on @aa-joshi, @angles-n-daemons, @arjunmahishi, and @rafiss)


pkg/ccl/logictestccl/testdata/logic_test/event_log line at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

do you know why this had to be in the ccl package?

relevant pr: #132788
i'll make this a stacked PR on top of ^; it doesn't have to be in the ccl package after the above

With the deprecation of the core license, we no longer need to
an enterprise license check for configuring replication controls
regarding subzones. This patch mainly just performs clean-up -- as
in real servers, we overwrite `base.CheckEnterpriseEnabled` with the
one in `ccl/utilccl/license_check.go`, which always returns true now.

Epic: None

Release note: None
This patch adds another field in `eventpb.SetZoneConfig`.
This field, `ResolvedOldConfig`, will aid in logging the zone
configuration that we have changed.

We use the `completeZone/completeSubzone` here because we want to
be more useful in our zone config logging. The benefit of using the
complete* is that we can explicitly see what fields are changing,
even if they are actually modeled as a zone config that just inherits
from its parent. The disadvantage of this is that we are not able
to easily tell the inheritence of the old zone config, but knowing
the actual diff between the old vs new config seems more relevant
for debugging.

Fixes: cockroachdb#127176

Release note: None
This patch enables logging for index and partition
zone configs in the DSC.

Release note: None
This patch fills the `ResolvedOldConfig` field in
`eventpb.SetZoneConfig` to log the old zone configuration
in the declarative schema changer.

Informs: cockroachdb#127176

Release note: None
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.

sql: zone configuration changes logging enhancement
3 participants