Skip to content

kv, gossip: remove misc deprecated system config code #82329

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
RichardJCai:remove_keys_system_span_config
Jun 7, 2022
Merged

kv, gossip: remove misc deprecated system config code #82329
craig[bot] merged 1 commit intocockroachdb:masterfrom
RichardJCai:remove_keys_system_span_config

Conversation

@RichardJCai
Copy link
Copy Markdown
Contributor

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

A thing of beauty! Let's get somebody on KV to have a look. Maybe @irfansharif or @nvanbenschoten?

Comment on lines 230 to 236
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we be deleting this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can delete this but I'll look into it into a follow up.

@RichardJCai RichardJCai force-pushed the remove_keys_system_span_config branch from 12ac40d to 21ddc67 Compare June 2, 2022 14:52
@RichardJCai RichardJCai marked this pull request as ready for review June 2, 2022 14:52
@RichardJCai RichardJCai requested review from a team as code owners June 2, 2022 14:52
@RichardJCai RichardJCai requested a review from a team June 2, 2022 14:52
@RichardJCai RichardJCai requested a review from a team as a code owner June 2, 2022 14:52
@RichardJCai RichardJCai requested review from irfansharif and nvb June 2, 2022 15:12
Copy link
Copy Markdown
Contributor

@kvoli kvoli left a comment

Choose a reason for hiding this comment

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

LGTM, +@nvanbenschoten

nit: I think there should be a commit message. Referencing #76279 for posterity.

@kvoli kvoli assigned nvb Jun 3, 2022
Copy link
Copy Markdown
Contributor

@irfansharif irfansharif left a comment

Choose a reason for hiding this comment

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

I've paged a lot of this out, surprisingly, but the broad strokes LGTM. I'm curious what's left in order to get rid of all this code:

// SystemConfig embeds a SystemConfigEntries message which contains an
// entry for every system descriptor (e.g. databases, tables, zone
// configs). It also has a map from object ID to unmarshaled zone
// config for caching.
// The shouldSplitCache caches information about the descriptor ID,
// saying whether or not it should be considered for splitting at all.
// A database descriptor or a table view descriptor are examples of IDs
// that should not be considered for splits.
type SystemConfig struct {
.

@@ -2193,7 +2193,6 @@ func (s *Store) GetConfReader(ctx context.Context) (spanconfig.StoreReader, erro

if s.cfg.SpanConfigsDisabled ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we get rid of all these knobs now that we're no longer gossipping the system config span: SpanConfigsDisabled, spanconfigstore.EnabledSetting, s.TestingKnobs().UseSystemConfigSpanForQueues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you mean to resolve this comment? If we want to get rid of these in future commits, worth leaving a TODO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I swear I replied but the message disappeared.

I tried removing it but some tests were failing and it wasn't obvious to me why. I added two more TODOs to remove SpanConfigsDisabled and spanconfigstore.EnabledSetting and you already had one for s.TestingKnobs().UseSystemConfigSpanForQueues

@RichardJCai RichardJCai force-pushed the remove_keys_system_span_config branch from 21ddc67 to c122f24 Compare June 3, 2022 21:18
@blathers-crl blathers-crl bot requested a review from irfansharif June 3, 2022 21:18
@RichardJCai RichardJCai force-pushed the remove_keys_system_span_config branch from c122f24 to 4b1be2e Compare June 3, 2022 21:41
@RichardJCai
Copy link
Copy Markdown
Contributor Author

@irfansharif do you want to take another look here? I have some follow work here as well
#82281

Copy link
Copy Markdown
Contributor

@irfansharif irfansharif left a comment

Choose a reason for hiding this comment

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

or at least update SystemConfigSpan to contain just system.descriptor and
system.zones.

I'm not sure why we need an unsplittable span to contain those two tables specifically but happy to learn in your subsequent PRs. This is really great stuff, thanks for cleaning up the mess.

SystemConfigSpan: true,
},
}
etArgsWithTrigger.InternalCommitTrigger = &roachpb.InternalCommitTrigger{}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need this line at all, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We still do, it changes how the lock span is populated below.
I'm just gonna update it to use a NodeLiveness span instead in the Trigger.

@@ -2193,7 +2193,6 @@ func (s *Store) GetConfReader(ctx context.Context) (spanconfig.StoreReader, erro

if s.cfg.SpanConfigsDisabled ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you mean to resolve this comment? If we want to get rid of these in future commits, worth leaving a TODO.

@RichardJCai RichardJCai changed the title kv, gossip: remove deprecated system span config kv, gossip: remove misc deprecated system config code Jun 7, 2022
@RichardJCai
Copy link
Copy Markdown
Contributor Author

I've paged a lot of this out, surprisingly, but the broad strokes LGTM. I'm curious what's left in order to get rid of all this code:

Added a comment for this.

// NB: SystemConfig can be updated to only contain system.descriptor and
// system.zones. We still need SystemConfig for SystemConfigProvider which is
// used in replication reports and the opt catalog.

There is still some work left to actually remove `SystemConfigSpan`
or at least update `SystemConfigSpan` to contain just system.descriptor and
system.zones.

cockroachdb#76279

Release note: None
@RichardJCai RichardJCai force-pushed the remove_keys_system_span_config branch from 4b1be2e to dc80d3c Compare June 7, 2022 20:17
@RichardJCai
Copy link
Copy Markdown
Contributor Author

Thanks for reviewing!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 7, 2022

Build succeeded:

@craig craig bot merged commit 0c8f826 into cockroachdb:master Jun 7, 2022
craig bot pushed a commit that referenced this pull request Feb 25, 2025
140160: sql: rollback transaction eagerly upon error r=rafiss a=rafiss

### sql: rollback transaction eagerly upon error

If we have not used any savepoints, it's safe to rollback the
transaction immediately when a non-retryable error is encountered.

This releases locks sooner, which is useful so we avoid needing to wait
until the client sends a ROLLBACK statement.

Release note (bug fix): Transactions that enter the aborted state will
now release locks they are holding immediately, as long as there is no
SAVEPOINT active in the transaction.

### sql: make transaction_timeout abort transaction eagerly

Previously, the transaction_timeout setting would only cause the
transaction to abort if the timeout had already expired by the time the
next statement is received by CRDB. Now we create a timer that fires if
the timeout expires while we are waiting for the next statement.

There's no release note, since up until the previous commit, which
changed the behavior so transactions eagerly release locks, there was no
functional difference caused by lazily timing out the transaction.

Release note: None

###  sql: add test for implicit txn holding locks across retries

Release note: None

---

fixes #140234


141815: systemconfigwatcher: remove NewWithAdditionalProvider r=rafiss a=rafiss

This was needed in the 21.2-22.1 mixed version state, before tenants had a spanconfig reconciliation job. Now that the job exists, there's no need to pass in an additional provider for tenants.

This takes the work in #82329 a bit further.

informs #76625
Release note: None

Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
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.

6 participants