Skip to content

clusterversion: proto Unmarshal on each version check #113385

@pav-kv

Description

@pav-kv

As discovered in #111561, the IsActive cluster version check is on many hot paths. Today it incurs a protobuf Unmarshal, which until recently also allocated (#113043) and amounted as much as 1% of allocations in some tests.

While we got rid of the allocation, we should take it further and be able to do the cluster version checks without unmarshaling protos in the first place.

@dt says:

we could also just move clusterversion.proto into another package that pkg/settings is allowed to depend on and then store a *ClusterVersion in the atomic instead of a []byte so there'd be no unmarshal -- allocating or otherwise -- on the hot path.

Jira issue: CRDB-32919

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)C-performancePerf of queries or internals. Solution not expected to change functional behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions