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

kvserver: add cluster setting to disable transactionally writing node… #85593

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

shralex
Copy link
Contributor

@shralex shralex commented Aug 4, 2022

… and range events into system tables

Currently splits, merges, and rebalances all log transactionally to the system.rangelog table.
Node membership events are logged into the system.eventlog table. This introduces a dependency
that can cause issues when these system tables are unavailable. This PR introduces a cluster
setting to disable writing these events. Note that decommissioning events aren't control by
this setting and are always written.

Release note: a new cluster setting (kv.log_range_and_node_events.enabled) is introduced to
disable transactionally logging range events (e.g., merges, splits and rebalancing)
and node join and restart events to system tables, to remove the dependency on such tables
and improve performance.

Release justification: stability improvement

FIxes #82535

@shralex shralex requested review from a team as code owners August 4, 2022 03:59
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@shralex shralex requested review from nvanbenschoten and removed request for a team August 4, 2022 04:05
@knz
Copy link
Contributor

knz commented Aug 4, 2022

Tip: make the bool a DisableXXX, so that the go default value (false) ensures that the previous behavior (logs enabled) is preserved.

Also, you'll need to update the initialization code in various places that set that boolean to the desired default value, for use in tests.

I'm also curious as to why the cluster setting is only used in some places and not all, and why there's no opt-out for decommissioning events.

Also, nit, the commit message contains some stray sentences.

Copy link
Member

@nvanbenschoten nvanbenschoten 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 @nvanbenschoten and @shralex)


pkg/kv/kvserver/log.go line 82 at r1 (raw file):

	}

	if !s.cfg.LogRangeAndNodeEvents && !logRangeAndNodeEventsEnabled.Get(&s.ClusterSettings().SV) {

Should this be if !s.cfg.LogRangeAndNodeEvents || !logRangeAndNodeEventsEnabled.Get(&s.ClusterSettings().SV)?


pkg/kv/kvserver/store.go line 1111 at r1 (raw file):

			" (e.g., split, merge, add/remove voter/non-voter) into system.rangelog"+
			"and node join and restart events into system.eventolog",
		false,

Don't we want this to default to true?

Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm: thanks!

Reviewed 2 of 4 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @shralex)

@shralex shralex force-pushed the rangelog branch 2 times, most recently from 83f5bba to dd5e9ac Compare August 23, 2022 04:03
@ajwerner
Copy link
Contributor

This is something on my radar. The dependency of the low-level transactions on the internal executor leads to special cases I'm going to need to eliminate in 23.1. My plan was to just use the raw KV API to perform these writes. If we're going to just get rid of the writes, that also makes me happy. I'll file an issue tomorrow, just writing this out as I see it fly by.

@knz
Copy link
Contributor

knz commented Aug 23, 2022

Have you considered something akin to the new code for system.eventlog, which performs these writes async now?

… and range events into system tables

Currently splits, merges, and rebalances all log transactionally to the system.rangelog table.
Node membership events are logged into the system.eventlog table. This introduces a dependency
that can cause issues when these system tables are unavailable. This PR introduces a cluster
setting to disable writing these events. Note that decommissioning events aren't control by
this setting and are always written.

Release note: a new cluster setting (kv.log_range_and_node_events.enabled) is introduced to
disable transactionally logging range events (e.g., merges, splits and rebalancing)
and node join and restart events to system tables, to remove the dependency on such tables
and improve performance.

Release justification: stability improvement
@shralex
Copy link
Contributor Author

shralex commented Aug 25, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

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

@shralex
Copy link
Contributor Author

shralex commented Aug 25, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Already running a review

@craig
Copy link
Contributor

craig bot commented Aug 25, 2022

Build succeeded:

@craig craig bot merged commit b5e32df into cockroachdb:master Aug 25, 2022
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.

kv: add cluster setting to disable rangelog events
5 participants