-
Notifications
You must be signed in to change notification settings - Fork 881
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
Allow pass global datastore config after boot #908
Conversation
if !ok { | ||
return | ||
} | ||
a.updateBitMasks(aSpace) | ||
aSpace.Lock() |
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.
can you avoid locking aSpace
around CheckConsistency
?
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 need to iterate through the address space's map of pools. I don't think I can avoid this lock.
Anyway, the consistency check is run either at allocator creation or during datastore update. There won't be other activity on the datastore during these two phases. I mean to say this locking would not be on the way of some other request.
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 still would like to avoid it. We cannot look at today's code and break a practice that we are following across other parts of the code. It will cause unncessary headaches in the long run, because of this particular assumption that it will not cause a deadlock with the current implementation.
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.
Right, the reason I am locking is in fact because I do not want to make any assumptions.
I am missing what problem would cause locking the address space while running CheckConsistency
on the bitmask. An address space is tied to a datastore, we need to lock it while we run the consistency check on its subnets.
if !ok { | ||
return types.InternalErrorf("incorrect data in datastore update notification: %v", data) | ||
} | ||
d.store, err = datastore.NewDataStoreFromUpdate(datastore.GlobalScope, dsu) |
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.
When is VxlanIdm initialized in this case ?
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.
Still in d.configure()
. I have retained the existing lazy logic where the programming is done on first network create.
Signed-off-by: Alessandro Boch <aboch@docker.com>
for _, ds := range c.stores { | ||
if ds.Scope() == datastore.GlobalScope { | ||
c.Unlock() | ||
return types.ForbiddenErrorf( |
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.
This must fail ONLY if the config has changed.
If the config is exactly the same, this function must return immediately without any error.
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.
Addressed
- After boot via ReloadConfiguration() method Signed-off-by: Alessandro Boch <aboch@docker.com>
@aboch thanks for addressing all the comments. LGTM |
LGTM |
Allow pass global datastore config after boot
The new So are plugins really forced to implement two methods that are neither documented nor ever invoked? Am I missing something? |
@rade |
According to the docs "The IPAM driver (internal or remote) has to comply with the contract specified in ipamapi.contract.go". That contract now includes those two methods. We, and I suspect other plugin implementers working in golang, took that instruction quite literal and are using that interface as a type in the plugin implementation. |
@rade I will update the docs. Thanks. |
Cheers. It would be really handy if there was a golang interface that defines the API. Just as there used to be before this change. |
@rade we have |
- LocalKVProvider, LocalKVProviderConfig, LocalKVProvider, GlobalKVProviderConfig are all unused since moby/libnetwork#908. - MakeKVProvider, MakeKVProviderURL, MakeKVProviderConfig are unused since moby#44683. - MakeKVClient is unused since moby#44875 Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 781e666a and c11c2a16. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 781e666a and c11c2a16. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 781e666a and c11c2a16. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 652d1bf and 5e9e400. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 652d1bf and 5e9e400. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 652d1bf and 5e9e400. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since moby/moby@96cfb076 (moby#44683). - MakeKVClient is unused since moby/moby@142b5229 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since bb54332 and 06e41ba. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since 96cfb07 (moby#44683). - MakeKVClient is unused since 142b522 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
- LocalKVProvider, LocalKVProviderURL, LocalKVProviderConfig, GlobalKVProvider, GlobalKVProviderURL and GlobalKVProviderConfig are all unused since moby/libnetwork@be2b6962 (moby/libnetwork#908). - GlobalKVClient is unused since 0fa873c and c8d2c6e. - MakeKVProvider, MakeKVProviderURL and MakeKVProviderConfig are unused since 96cfb07 (moby#44683). - MakeKVClient is unused since 142b522 (moby#44875). Signed-off-by: Albin Kerouanton <albinker@gmail.com>
Signed-off-by: Alessandro Boch aboch@docker.com