cloudwan / gohan

Gohan is an API Gateway Server written by Go that makes it easy for developers to create and maintain REST-style API
http://www.slideshare.net/natiueno/gohan-61170476
Other
109 stars 44 forks source link

[BL-355] Do not send Get() request when starting revision is specified #730

Closed p-kozlowski closed 5 years ago

p-kozlowski commented 5 years ago

ETCD's API does allow Get() with a selected revision, but it's impossible to express "Get() with a revision equal or greater". When a Watch() is requested starting an given revision, we just omit the call to Get().

Previously the API will return the current revision of the given key, not the one the API user requested. Ie. the newly added test will fail with mismatch response: &{Action:get Key:/path/to/watch/with/starting/revision Data:map[version:2] Revision:56501 Err:<nil>}, expecting version==1, revision==56500 (as seen in the CI)

p-kozlowski commented 5 years ago

let me decline this PR and merge it with #725. the reason is that removing Get() will cause issues with etcd compaction. keeping the 2 PRs will require doing the same work twice as the affected code has been changed significantly in #725.