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 option to enable/disable txn id cache #76523

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

Azhng
Copy link
Contributor

@Azhng Azhng commented Feb 14, 2022

Reviewer note: only last commit is relevant


Resolves #76329

Release note (sql change): when sql.contention.txn_id_cache.max_size
is set to 0, it would effectively turn off transaction ID cache.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@Azhng Azhng requested a review from a team February 14, 2022 18:42
@Azhng Azhng marked this pull request as ready for review February 14, 2022 18:42
Copy link
Contributor

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

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

Funny timing, I was reading the initial settings RFC earlier today, and I saw this section, which IIUC would recommend instead using the existing sql.contention.txn_id_cache.max_size setting with a value of 0 to disable the txn id cache.

Perhaps that philosophy has been superseded by something else? But when I look through the generated settings.html, I'm mostly seeing either .enabled or .<value>, but not both. WDYT?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@Azhng Azhng force-pushed the ctn-cluster-setting-gate branch 2 times, most recently from f82e1ff to f6cae3b Compare February 14, 2022 19:25
Copy link
Contributor Author

@Azhng Azhng left a comment

Choose a reason for hiding this comment

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

Good point. Changed this to use the special zero value.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

Copy link
Contributor

@matthewtodd matthewtodd 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 @Azhng and @matthewtodd)


pkg/sql/contention/txnidcache/cluster_settings.go, line 20 at r5 (raw file):

	`sql.contention.txn_id_cache.max_size`,
	"the maximum byte size TxnID cache will use. Set it to zero to disable "+
		"txn id cache",

I'm reading the other settings, git grep 'to 0' docs/generated/settings/settings-for-tenants.txt, and maybe something like "the maximum byte size TxnID cache will use (set to 0 to disable)" or "the maximum byte size TxnID cache will use; if set to 0, the TxnID cache is disabled" would fit the existing style, WDYT?

Copy link
Contributor Author

@Azhng Azhng 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 @matthewtodd)


pkg/sql/contention/txnidcache/cluster_settings.go, line 20 at r5 (raw file):

Previously, matthewtodd (Matthew Todd) wrote…

I'm reading the other settings, git grep 'to 0' docs/generated/settings/settings-for-tenants.txt, and maybe something like "the maximum byte size TxnID cache will use (set to 0 to disable)" or "the maximum byte size TxnID cache will use; if set to 0, the TxnID cache is disabled" would fit the existing style, WDYT?

Done.

Copy link
Contributor

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

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

Thanks! :lgtm:

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

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Nit: you need to update your PR title/description to match your new implementation

Reviewed 2 of 2 files at r1, 5 of 5 files at r2, 6 of 6 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @maryliag and @matthewtodd)

@Azhng Azhng changed the title sql: add cluster setting to enable/disable txn id cache sql: add option to enable/disable txn id cache Feb 15, 2022
@Azhng
Copy link
Contributor Author

Azhng commented Feb 15, 2022

Done.

Resolves cockroachdb#76329

Release note (sql change): when `sql.contention.txn_id_cache.max_size`
is set to 0, it would effectively turn off transaction ID cache.
@Azhng
Copy link
Contributor Author

Azhng commented Feb 16, 2022

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 16, 2022

Build succeeded:

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.

feature flag for txn id cache
4 participants