-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
auth: keep old revision in 'NewAuthStore' #7364
Conversation
auth/store.go
Outdated
@@ -916,7 +916,7 @@ func NewAuthStore(be backend.Backend, indexWaiter func(uint64) <-chan struct{}) | |||
as.simpleTokenKeeper = NewSimpleTokenTTLKeeper(newDeleterFunc(as)) | |||
} | |||
|
|||
as.commitRevision(tx) | |||
as.commit(tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the initial version needs to commit with rev=1. Maybe:
if as.revision == 0 {
as.commitRevision()
}
@@ -38,6 +38,33 @@ func dummyIndexWaiter(index uint64) <-chan struct{} { | |||
return ch | |||
} | |||
|
|||
// TestNewAuthStoreRevision ensures newly auth store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there probably should be an integration test that restarts the etcd server and checks the hash stays the same / fails without this patch
When there's no changes yet (right after auth store initialization), we should commit old revision. Fix etcd-io#7359.
@heyitsanthony PTAL. Thanks. |
lgtm defer to @mitake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
I added the |
@gyuho BTW can I ignore the fail of jenkins-proxy-ci? It seems to be the internal problem of the server. Or could you restart the CI? |
Yeah proxy CI doesn't seem related to this fix. Thanks. |
When there's no changes yet (right after auth
store initialization), we should commit old revision.
Fix #7359.
Seems like
commitRevision
was introduced long time ago,and we recently fixed it to have correct revision in
authStore
,so it starts failing in our hash tests.
Do we have any reason to bump up revision for every
commitRevision
call,even around store initialization?