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

Cache Capability to indicate that CAS is read-only #297

Open
sluongng opened this issue May 30, 2024 · 2 comments
Open

Cache Capability to indicate that CAS is read-only #297

sluongng opened this issue May 30, 2024 · 2 comments

Comments

@sluongng
Copy link
Contributor

We need to signal to the client that in some configurations, the CAS will only accept read requests. All write requests will result in errors.

Given that we are currently advertising

// Describes the server/instance capabilities for updating the action cache.
message ActionCacheUpdateCapabilities {
  bool update_enabled = 1;
}

in CacheCapabilities proto. I was thinking that we could simply add another identical field for CASUpdateCapabilities.

However, such a field would default to false, which is troublesome for backward compatibility. And doing bool is_readonly = 1; feels out of spec. Looking for feedback on this design.

@EdSchouten
Copy link
Collaborator

EdSchouten commented May 30, 2024

Use an enum where 0 indicates it’s writable? Or place it in a nested message. If the message is absent, clients may assume legacy behaviour where the CAS is writable.

@bergsieker
Copy link
Collaborator

I think the right course is an enum with UNKNOWN=0, WRITEABLE, READ-ONLY as the values. It's possible there are other CAS read-only CAS implementations (e.g., local caches), and we shouldn't extend the API in a way that invalidates their position by default.

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

No branches or pull requests

3 participants