Skip to content

[cache/linear] Expose cache version#1467

Closed
nezdolik wants to merge 1 commit into
mainfrom
linear-cache-version
Closed

[cache/linear] Expose cache version#1467
nezdolik wants to merge 1 commit into
mainfrom
linear-cache-version

Conversation

@nezdolik

@nezdolik nezdolik commented May 11, 2026

Copy link
Copy Markdown
Member

Description

Expose version in linear cache as public getter.

#

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Go Toolchain:

Checklist:

  • I have made corresponding changes to the changelog
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I've added sufficient test coverage for my change. If not, please explain why.

Signed-off-by: Kateryna Nezdolii <kateryna.nezdolii@isovalent.com>

@valerian-roche valerian-roche left a comment

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.

Can you provide a rationale to increase the public interface?
I am hoping to fully remove this "version" from the linear cache as it's irrelevant in delta mode and is arbitrary in sotw.

Comment thread pkg/cache/v3/linear.go
}

func (cache *LinearCache) GetVersion() uint64 {
return cache.version

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.

This cannot be returned without concurrency protection. version is only touched under lock today.
Also the version integer is an internal detail. The version from a public API point-of-view is a string with the provided version prefix, not this integer

@nezdolik

nezdolik commented May 12, 2026

Copy link
Copy Markdown
Member Author

The need for this change occurred while migrating cilium custom xds control plane to use go control plane in ADS SOTW mode. In cilium control plane we send core Envoy resource and custom resources (like network policy). Since Snapshot cache (which exposes xds resource version) does not support custom resource types (we try to avoid to use TypedExtensionConfig for now), I have to use linear cache for custom resource types (and then combine linear caches with snapshot cache into a mux cache). Cilium control plane registers "await" objects (based on xds node Id, resource version set by cache and type url) and performs certain actions based on when await objects have been acked or if they timed out. In our case we care about resource version which is being set by cache and being sent on the stream it does not need to be user friendly or human readable. Since snapshot cache exposes resource version it would be meaningful to also expose resource version in linear cache to be able to use those cache types in mux cache. String resource version would work as well, we will just parse it on out side to extract the integer value (we care about what is being actually sent on stream).

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot added the stale label Jun 11, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions Bot closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants