-
Notifications
You must be signed in to change notification settings - Fork 9
AUE-23: When key doesn't exist, prohibits reject rules specifying ver… #35
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| Forced nonexistant key to ban reject-rules specifying versionLE or versionNE | ||
|
|
||
| From: nobody <nobody@nowhere> | ||
|
|
||
|
|
||
| --- | ||
| src/ObjectManager.cc | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/src/ObjectManager.cc b/src/ObjectManager.cc | ||
| index 9c2d3b0c..5f4a6e79 100644 | ||
| --- a/src/ObjectManager.cc | ||
| +++ b/src/ObjectManager.cc | ||
| @@ -2893,7 +2893,7 @@ Status | ||
| ObjectManager::rejectOperation(const RejectRules* rejectRules, uint64_t version) | ||
| { | ||
| if (version == VERSION_NONEXISTENT) { | ||
| - if (rejectRules->doesntExist) | ||
| + if (rejectRules->doesntExist || rejectRules->versionLeGiven || rejectRules->versionNeGiven) | ||
| return STATUS_OBJECT_DOESNT_EXIST; | ||
| return STATUS_OK; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,17 +2,32 @@ | |
| import argparse | ||
| import sys | ||
|
|
||
| # If you're trying to make fake data in RAMCloud, this works from Python3 interpreter, | ||
| # assuming you started up the default 3-node test cluster: | ||
| # | ||
| # >>> import ramcloud | ||
| # >>> import cluster_test_utils as ctu | ||
| # >>> rc = ramcloud.RAMCloud() | ||
| # >>> rc.connect('zk:10.0.1.1:2181,10.0.1.2:2181,10.0.1.3:2181', 'main') | ||
| # >>> rc.create_table('test') | ||
| # >>> tid = rc.get_table_id('test') | ||
| # >>> rc.write(tid, 'testKey', 'testValue') | ||
| # >>> rc.read(tid, 'testKey') | ||
|
|
||
| if __name__ == '__main__': | ||
| parser = argparse.ArgumentParser() | ||
| parser.add_argument('--action', '-a', metavar='A', type=str, default="status", | ||
| help="Defines the action to take: status, reset, start, stop") | ||
| help="Defines the action to take: status, reset, log, start, stop") | ||
| parser.add_argument('--nodes', '-n', type=int, default=3, | ||
| help="Number of zk, rc-coordinator, and rc-server instances to bring up. Only relevant when there's no cluster up yet. Default is 3") | ||
| parser.add_argument('--path', '-p', type=str, default="/src/tmp", | ||
| help="Path to place logs in when action is set to \"log\"") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it would be clearer to name the option and the variable "log_path". |
||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| print("action =",args.action) | ||
| print("nodes =",args.nodes) | ||
| print("path =",args.path) | ||
| if (args.action == "start"): | ||
| x = ctu.ClusterTest() | ||
| x.setUp(num_nodes = args.nodes) | ||
|
|
@@ -21,6 +36,14 @@ | |
| elif (args.action == "stop"): | ||
| docker_network, docker_containers = ctu.get_status() | ||
| ctu.destroy_network_and_containers(docker_network, docker_containers) | ||
| elif (args.action == "log"): | ||
| docker_network, docker_containers = ctu.get_status() | ||
| if (not docker_network or not docker_containers): | ||
| print("No network or containers currently up to log") | ||
| exit() | ||
| ensemble = ctu.get_ensemble(len(docker_containers)) | ||
| ctu.output_logs_detached(docker_containers, args.path) | ||
| ctu.output_zk_detached(ensemble, args.path) | ||
| elif (args.action == "reset"): | ||
| docker_network, docker_containers = ctu.get_status() | ||
| if (not docker_network): | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what does "detached" mean here?
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.
We are not attached to a ClusterTestUtil object that brings up the test cluster from scratch, instead, we're detached from that cluster, but still trying to connect to it to get logs.