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

Document why all REST calls return resourceVersion #2171

Closed
abonas opened this issue Nov 5, 2014 · 5 comments
Closed

Document why all REST calls return resourceVersion #2171

abonas opened this issue Nov 5, 2014 · 5 comments
Assignees
Labels
area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation.

Comments

@abonas
Copy link
Contributor

abonas commented Nov 5, 2014

What is the meaning (and the purpose) of PodList resourceVersion? - isn't it just the collection of current pods? In which circumstances does it change? when a new pod is added? when any pod is updated? Is there any use case when the REST api user should refer to the collection's resourceVersion and/or pass this version to the server? (when do users pass a list of pods to the server?)
thank you.

@bgrant0607 bgrant0607 changed the title why PodList has a resourceVersion in REST api? Document why all REST calls return resourceVersion Nov 5, 2014
@bgrant0607 bgrant0607 added area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation. labels Nov 5, 2014
@bgrant0607 bgrant0607 self-assigned this Nov 5, 2014
@bgrant0607 bgrant0607 added this to the v0.8 milestone Nov 5, 2014
@bgrant0607
Copy link
Member

Great questions. Keep them coming. We're going to overhaul the documentation soon.

Regarding this issue, see #1184. The value of resourceVersion is currently etcd's sequencer. Think of it as a logical clock the apiserver can use to order requests.

@abonas
Copy link
Contributor Author

abonas commented Nov 5, 2014

@bgrant0607 I would say that the client side shouldn't be aware/consider server side ordering issues - that should be completely a server side implementation detail how the requests are ordered. Clients should be exposed solely to information they can/should do something about (create an entity, change a property on an entity, etc.)
Is there any specific usecase that the client should take care of a collection's resourceVersion or it can be safely ignored? Can you give an example when the client needs to pass it back to server at all?
Thank you!

@lavalamp
Copy link
Member

lavalamp commented Nov 5, 2014

More specifically, the resourceVersion in a list is the resourceVersion at which one must start watching if one wants to be certain not to miss any changes.

@lavalamp
Copy link
Member

lavalamp commented Nov 5, 2014

Clients should treat it as an opaque field, of course.

@smarterclayton
Copy link
Contributor

I think for future implementors of alternate backends we should document we assume that the underlying store supports snapshot isolation reads, and the resource version is the global transaction id (or resource local transaction id) that supports a subsequent read. Since we like watch as a pattern, and we depend on it from a number of places.

bgrant0607 added a commit to bgrant0607/kubernetes that referenced this issue Nov 17, 2014
brendandburns added a commit that referenced this issue Nov 17, 2014
Documentation improvements. Fixes #2004, #2115, #2171.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates an issue on api area. kind/documentation Categorizes issue or PR as related to documentation.
Projects
None yet
Development

No branches or pull requests

4 participants