-
Notifications
You must be signed in to change notification settings - Fork 4.1k
clusterversion: proto Unmarshal on each version check #113385
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution 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.Perf of queries or internals. Solution not expected to change functional behavior.
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution 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.Perf of queries or internals. Solution not expected to change functional behavior.