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

Providing KVObject option to skip persisting object in kvstore #554

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

mavenugo
Copy link
Contributor

Signed-off-by: Madhu Venugopal madhu@docker.com

@mavenugo
Copy link
Contributor Author

@mrjana @chenchun addresses the missing skip option in #466

@@ -79,6 +79,33 @@ func testLocalBackend(t *testing.T, provider, url string, storeConfig *store.Con
}
}

func testNoPersist(t *testing.T, provider, url string, storeConfig *store.Config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function definition should be func TestNoPersist(t *testing.T) ?

@chenchun
Copy link
Contributor

Also add a check before watching endpoints? https://github.com/docker/libnetwork/blob/master/controller.go#L297

@mavenugo
Copy link
Contributor Author

@chenchun good point. will do that.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
@mavenugo
Copy link
Contributor Author

@chenchun took care of the comment by adding the check in WatchEndpoint directly which makes it more robust for any calls made to WatchEndpoint from other parts of the code.

@chenchun
Copy link
Contributor

LGTM

@@ -61,6 +61,8 @@ type KV interface {
Exists() bool
// DataScope indicates the storage scope of the KV object
DataScope() DataScope
// Skip provides a way for a KV Object to avoid persisting it in the KV Store
Skip() bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name it SkipPersist to be clear? Right now we don't know what we are skipping on?

Edit: on looking at the complete diff may be Skip makes sense since you are skipping to put the object on the kv store altogether. But IMO this decision could be made outside of the datastore. If you are skipping data store you just don't invoke data store ops in the caller site rather than forcing every object to provide a Skip method

@mrjana
Copy link
Contributor

mrjana commented Sep 22, 2015

LGTM

mrjana added a commit that referenced this pull request Sep 22, 2015
Providing KVObject option to skip persisting object in kvstore
@mrjana mrjana merged commit ed0597b into moby:master Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants