-
Notifications
You must be signed in to change notification settings - Fork 2
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
brick_server new client API - rename #2
Comments
New rename implementation for gdss-brick and gdss-client. Removed deprecated update and append API from gdss-client. |
New rename implementation for gdss-admin. |
Disable server implementation of rename. |
Prototype for this change request is on branch norton-server-rename. |
I tried the prototype and found one issue. If I don't use a binary but string for the new key, the key value will be lost. I'll look after this issue. |
Updated QuickCheck (qc) to detect the issue above. hibari/gdss-admin@d101a50 To run qc, the repo manifest has to be updated. I'll do so after work. |
I've been doing source code reivew and checked the write path for rename operation. I didn't find any obvious place to cause the issue on 7th comment.
I think possible cause of the issue might be I'm going to enable the tracepoints to see the rename operation in action. |
I fixed the issue described in 7th comment (#2 (comment)) and pushed the changes to norton-server-rename branch. Commit: fe1091c Cause: Note: I was wrong in 10th comment (#2 (comment)). Keys are not stored "as is", but converted to binary just as I first thought. So my QuickCheck cases were actually correct. Verification (hibariclient@127.0.0.1)2> simple_eqc_tests:run(2000).
prop_simple1:
...
Hibari: get_many() has been commented out from command()
.c......v....Yv....c.vvv.Y....vYY..v...c...cc.......Y.c.
...
OK, passed 2000 tests
51.05% {0,div10}
23.20% {1,div10}
12.45% {2,div10}
6.55% {3,div10}
3.45% {4,div10}
1.40% {5,div10}
0.75% {6,div10}
0.35% {7,div10}
0.30% {8,div10}
0.15% {11,div10}
0.15% {9,div10}
0.10% {10,div10}
0.05% {14,div10}
0.05% {13,div10}
prop_simple1_noproc_ok:
...
Hibari: get_many() has been commented out from command()
v.c...Y.v..v............vvcv.c..c.cY..v.c.Y.......Y..v..
...
OK, passed 2000 tests
50.60% {0,div10}
24.20% {1,div10}
12.05% {2,div10}
6.55% {3,div10}
2.75% {4,div10}
1.80% {5,div10}
1.05% {6,div10}
0.40% {7,div10}
0.35% {8,div10}
0.10% {11,div10}
0.10% {9,div10}
0.05% {10,div10}
[] |
Merged into the dev branch: |
I decided the following things:
Target milestone is still v0.3.0. (Edit) |
I made a prototype of this (commit) but then realized this breaks modification replay in downstream bricks because it changes the order of modifications by delaying rename operation. I decided not to do squidflash-priming in downstream bricks. (I reverted the commit in the very next commit.) |
I have decided to include this feature (
|
Changing the milestone from v0.3 to v0.1.11. |
QuickCheck property [{set,{var,1},
{call,simple_eqc_tests,simple_set,
[["/foo/bar/",["000",50]],
<<"v a">>,1426323338786789025,
[{exp_time_directive,keep}],
[{attrib2,"val2"}]]}},
{set,{var,2},
{call,simple_eqc_tests,simple_set,
[<<"/foo/bar/0001">>,<<"v a">>,1426323338789594039,
[{exp_time_directive,replace},{attrib_directive,keep}],
[]]}},
{set,{var,3},
{call,simple_eqc_tests,simple_rename,
[<<"/foo/bar/0001">>,
["/foo/bar/",["000",50]],
1426323338789723040,
[{exp_time_directive,keep},{attrib_directive,keep}],
[]]}},
{set,{var,4},
{call,simple_eqc_tests,simple_get,["/foo/bar/0002",[get_all_attribs]]}}]
S = {state,5,
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,1426323338789594039},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{<<"/foo/bar/0001">>,[]},
{<<"/foo/bar/0002">>,[<<"v a">>]},
{<<"/foo/bar/0003">>,[]},
{<<"/foo/bar/0004">>,[]}],
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,[]},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{tab1_ch1_b1,gdss_eunit@localhost}]}
R = {postcondition,false}
Hist = [{eqc_statem_history,
{state,1,
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,undefined},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{<<"/foo/bar/0001">>,[]},
{<<"/foo/bar/0002">>,[]},
{<<"/foo/bar/0003">>,[]},
{<<"/foo/bar/0004">>,[]}],
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,undefined},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{tab1_ch1_b1,gdss_eunit@localhost}]},
{call,simple_eqc_tests,simple_set,
[["/foo/bar/",["000",50]],
<<"v a">>,1426323338786789025,
[{exp_time_directive,keep}],
[{attrib2,"val2"}]]},
[],
{normal,{ok,1426323340565845}}},
{eqc_statem_history,
{state,2,
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,1426323338786789025},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{<<"/foo/bar/0001">>,[]},
{<<"/foo/bar/0002">>,[<<"v a">>]},
{<<"/foo/bar/0003">>,[]},
{<<"/foo/bar/0004">>,[]}],
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,[{attrib2,"val2"}]},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{tab1_ch1_b1,gdss_eunit@localhost}]},
{call,simple_eqc_tests,simple_set,
[<<"/foo/bar/0001">>,<<"v a">>,1426323338789594039,
[{exp_time_directive,replace},{attrib_directive,keep}],
[]]},
[],
{normal,{ok,1426323340572921}}},
{eqc_statem_history,
{state,3,
[{<<"/foo/bar/0001">>,1426323338789594039},
{<<"/foo/bar/0002">>,1426323338786789025},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{<<"/foo/bar/0001">>,[<<"v a">>]},
{<<"/foo/bar/0002">>,[<<"v a">>]},
{<<"/foo/bar/0003">>,[]},
{<<"/foo/bar/0004">>,[]}],
[{<<"/foo/bar/0001">>,[]},
{<<"/foo/bar/0002">>,[{attrib2,"val2"}]},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{tab1_ch1_b1,gdss_eunit@localhost}]},
{call,simple_eqc_tests,simple_rename,
[<<"/foo/bar/0001">>,
["/foo/bar/",["000",50]],
1426323338789723040,
[{exp_time_directive,keep},{attrib_directive,keep}],
[]]},
[],
{normal,{ok,1426323340580630}}},
{eqc_statem_history,
{state,4,
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,1426323338789594039},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{<<"/foo/bar/0001">>,[]},
{<<"/foo/bar/0002">>,[<<"v a">>]},
{<<"/foo/bar/0003">>,[]},
{<<"/foo/bar/0004">>,[]}],
[{<<"/foo/bar/0001">>,undefined},
{<<"/foo/bar/0002">>,[]},
{<<"/foo/bar/0003">>,undefined},
{<<"/foo/bar/0004">>,undefined}],
[{tab1_ch1_b1,gdss_eunit@localhost}]},
{call,simple_eqc_tests,simple_get,
["/foo/bar/0002",[get_all_attribs]]},
[],
{normal,
{ok,1426323340580630,<<"v a">>,1426323338786789025,
[{val_len,3},{attrib2,"val2"}]}}}] |
Fixed this by 8c7fb13. Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8] [async-threads:64] [hipe] [kernel-poll:true]
Eshell V6.3 (abort with ^G)
(hibariclient@127.0.0.1)1> eqc:quickcheck(eqc:numtests(2000, simple_eqc_tests:prop_simple1())).
Hibari: get_many() has been commented out from command()
Starting Quviq QuickCheck version 1.33.3
(compiled at {{2015,2,9},{14,18,24}})
...
vY.YY.Yv....c.....c....Y.......cv.Y.v..c.Y....v....Y.v......c.c..
...
OK, passed 2000 tests
49.45% {0,div10}
25.00% {1,div10}
12.20% {2,div10}
5.75% {3,div10}
3.05% {4,div10}
2.00% {5,div10}
0.85% {6,div10}
0.80% {7,div10}
0.40% {9,div10}
0.20% {10,div10}
0.20% {8,div10}
0.05% {16,div10}
0.05% {11,div10}
true
(hibariclient@127.0.0.1)2> |
Rename a OldKey/Value pair to Key/Value pair in a brick, failing if OldKey does not already exist or if Key already exists. Similar to get_many, the rename API only works for keys of the same chain.
The text was updated successfully, but these errors were encountered: