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

storage.Interface KV impl. of etcd v3 #23387

Merged
merged 2 commits into from
Mar 31, 2016

Conversation

hongchaodeng
Copy link
Contributor

This is the initial implementation of #22448.

The PR consists of two parts:

  • add godep of "clientv3" and "integration" (for testing)
  • create new package "etcd3" under "pkg/storage/"
  • implement KV methods of storage.Interface using etcd v3 APIs
    • Create, Set, Get, Delete, GetToList, List, GuaranteedUpdate

@k8s-github-robot
Copy link

Labelling this PR as size/XL

@k8s-github-robot k8s-github-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 23, 2016
@k8s-bot
Copy link

k8s-bot commented Mar 23, 2016

GCE e2e build/test passed for commit 2265c02658ef11d704970a8c8a9947d15cdd44e5.

@k8s-bot
Copy link

k8s-bot commented Mar 23, 2016

GCE e2e build/test passed for commit a719726a717cba6d3bfa3a72861cf527f1302676.

@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

@wojtek-t
Copy link
Member

@timothysc @lavalamp - FYI

limitations under the License.
*/

package etcd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest making a new package for etcd3 and keeping the same function names rather than adding new functions to the same package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(If there's common functionality you want to reuse, that's fine, move it to a separate package :) )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, there's no way for users to avoid importing the etcd definition they don't want to use. Among other reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Will do it.

@k8s-bot
Copy link

k8s-bot commented Mar 24, 2016

GCE e2e build/test passed for commit 9dff3d90315d425ceb8f3c982d195d416a4faf36.

@k8s-bot
Copy link

k8s-bot commented Mar 24, 2016

GCE e2e build/test passed for commit c7ca2588aed468694a3b2b88acc82a85afb2f56b.

@k8s-bot
Copy link

k8s-bot commented Mar 24, 2016

GCE e2e build/test passed for commit 108c467447d0807d0e432d9918cce803631cd530.

@k8s-bot
Copy link

k8s-bot commented Mar 24, 2016

GCE e2e build/test passed for commit 77c3fabac7786bdc5ec58aaf9d180a78c2e872d5.

@timothysc
Copy link
Member

I'll look over in the a.m. , still catching up from PTO.

@k8s-bot
Copy link

k8s-bot commented Mar 24, 2016

GCE e2e build/test passed for commit 7a603376d8b8d074c305e83db2385154fbebce99.

@wojtek-t
Copy link
Member

I will take a look later today.


// extractRevision extracts revision from obj.
// If obj has resource version >0, it will be reset to 0.
func extractRevision(versioner storage.Versioner, obj runtime.Object) (int64, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably rename it to reflect the fact that resource version is set to 0 if different.
Maybe:
extractAndResetRevision
?

@hongchaodeng
Copy link
Contributor Author

Fixed comments

}
if !txnResp.Succeeded {
getResp = (*clientv3.GetResponse)(txnResp.Responses[0].GetResponseRange())
glog.Infof("deletion of %s failed because of a conflict, going to retry", key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for Info level vs V4? Just wondering...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake. I set V4 for guaranteedUpdate though :(

@timothysc
Copy link
Member

Minor comments, then lgtm for part 1.

@k8s-bot
Copy link

k8s-bot commented Mar 30, 2016

GCE e2e build/test passed for commit da6cda1157b6410275db1d6eda413e210b99bf9c.

This implements Get(), Create(), Delete(), GetToList(),
List(), GuaranteedUpdate().
@hongchaodeng
Copy link
Contributor Author

Addressed comments and squashed commits.
Thanks for the review :)

@k8s-bot
Copy link

k8s-bot commented Mar 30, 2016

GCE e2e build/test passed for commit 75eba2a39678fd0ada54c60c06077e4fa1ca819f.

@k8s-bot
Copy link

k8s-bot commented Mar 30, 2016

GCE e2e build/test passed for commit 00ddf06.

@k8s-bot
Copy link

k8s-bot commented Mar 30, 2016

GCE e2e build/test passed for commit c374a3218a544cb88d2ba89219c81958860bfe1c.

@timothysc timothysc added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 30, 2016
@timothysc
Copy link
Member

thx @hongchaodeng for seeing this through. part 1 lgtm.

@wojtek-t
Copy link
Member

LGTM too

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test failed for commit 00ddf06.

Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake.

@k8s-github-robot
Copy link

@timothysc
You must link to the test flake issue which caused you to request this manual re-test.
Re-test requests should be in the form of: k8s-bot test this issue: #<number>
Here is the list of open test flakes.

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2016
@hongchaodeng
Copy link
Contributor Author

Flake issue: #22671

@gmarek
Copy link
Contributor

gmarek commented Mar 31, 2016

@k8s-bot test this issue #22671

@gmarek
Copy link
Contributor

gmarek commented Mar 31, 2016

Readding lgtm label.

@gmarek gmarek added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2016
@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit 00ddf06.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Mar 31, 2016

GCE e2e build/test passed for commit 00ddf06.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet