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

Allow pass global datastore config after boot #908

Merged
merged 2 commits into from
Feb 17, 2016
Merged

Allow pass global datastore config after boot #908

merged 2 commits into from
Feb 17, 2016

Conversation

aboch
Copy link
Contributor

@aboch aboch commented Jan 28, 2016

  • This to allow the controller to update the datastore in the local IPAM driver and overlay driver at runtime, via Controller.ReloadConfiguration()

Signed-off-by: Alessandro Boch aboch@docker.com

if !ok {
return
}
a.updateBitMasks(aSpace)
aSpace.Lock()
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@aboch aboch changed the title Ipam driver to support datastore update Handle datastore update in Ipam and overlay drivers Feb 4, 2016
if !ok {
return types.InternalErrorf("incorrect data in datastore update notification: %v", data)
}
d.store, err = datastore.NewDataStoreFromUpdate(datastore.GlobalScope, dsu)
Copy link
Contributor

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 ?

Copy link
Contributor Author

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>
@aboch aboch changed the title Handle datastore update in Ipam and overlay drivers Allow pass global datastore config after boot Feb 17, 2016
for _, ds := range c.stores {
if ds.Scope() == datastore.GlobalScope {
c.Unlock()
return types.ForbiddenErrorf(
Copy link
Contributor

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.

Copy link
Contributor Author

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>
@mavenugo
Copy link
Contributor

@aboch thanks for addressing all the comments.

LGTM

@sanimej
Copy link

sanimej commented Feb 17, 2016

LGTM

sanimej pushed a commit that referenced this pull request Feb 17, 2016
Allow pass global datastore config after boot
@sanimej sanimej merged commit c4197ed into moby:master Feb 17, 2016
@rade
Copy link

rade commented Feb 18, 2016

The new DiscoverNew and DiscoverDelete aren't being passed through the IPAM remote plugin API. And the API docs haven't been updated either.

So are plugins really forced to implement two methods that are neither documented nor ever invoked? Am I missing something?

@aboch
Copy link
Contributor Author

aboch commented Feb 18, 2016

@rade
No IPAM plugins are not forced to implement those methods. In fact they will not receive any requests regarding those two new methods.

@rade
Copy link

rade commented Feb 18, 2016

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.

@aboch
Copy link
Contributor Author

aboch commented Feb 18, 2016

@rade I will update the docs. Thanks.

@rade
Copy link

rade commented Feb 18, 2016

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.

@mavenugo
Copy link
Contributor

@rade we have https://github.com/docker/go-plugins-helpers/tree/master/ipam for any proper docker plugin and we recommend you to use that as the API layer.

@aboch aboch deleted the dds branch March 7, 2016 16:44
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 9, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 16, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Feb 16, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 2, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 2, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 6, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 31, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Mar 31, 2023
- 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>
akerouanton added a commit to akerouanton/docker that referenced this pull request Apr 6, 2023
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants