Skip to content

Commit

Permalink
Prevent double unprefixing of keys in sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeconin committed May 8, 2012
1 parent 89a9bec commit d0f4afa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pylabs/test/server/quick/system_tests_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def sequence_scenario( start_suffix ):

cli.sequence( seq )

key_value_list = cli.range_entries( start_key, True, end_key, True )
key_value_list = cli.range_entries( start_key, True, end_key, True , 2*iter_size)
C.assert_key_value_list(start_suffix, iter_size , key_value_list )

seq = arakoon.ArakoonProtocol.Sequence()
Expand All @@ -264,7 +264,7 @@ def sequence_scenario( start_suffix ):
seq.addDelete(k)
cli.sequence( seq )

key_value_list = cli.range_entries( start_key, True, end_key, True )
key_value_list = cli.range_entries( start_key, True, end_key, True, 2*iter_size )
assert_equal( len(key_value_list), 0,
"Still keys in the store, should have been deleted" )

Expand All @@ -275,7 +275,7 @@ def sequence_scenario( start_suffix ):

seq.addDelete( "non-existing" )
assert_raises( ArakoonNotFound, cli.sequence, seq )
key_value_list = cli.range_entries( start_key, True, end_key, True )
key_value_list = cli.range_entries( start_key, True, end_key, True, 2*iter_size )
assert_equal( len(key_value_list), 0, "There are keys in the store, should not be the case" )

cli._dropConnections()
Expand Down
2 changes: 1 addition & 1 deletion src/hope/bstore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ module BStore = (struct
(fun a u ->
match a with
| OK SEQ_SUCCESS -> _inner tx u
| NOK k -> Lwt.return (NOK (unpref_key k))
| NOK k -> Lwt.return (NOK k)
| a -> Lwt.return a
)
(OK SEQ_SUCCESS)
Expand Down
3 changes: 1 addition & 2 deletions src/hope/c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ module ProtocolHandler (S:Core.STORE) = struct
open Baardskeerder
let prologue (ic,oc) =
let check magic version =
if magic = _MAGIC &&
version = _VERSION
if magic = _MAGIC && version = _VERSION
then Lwt.return ()
else Llio.lwt_failfmt "MAGIC %lx or VERSION %x mismatch" magic version
in
Expand Down

0 comments on commit d0f4afa

Please sign in to comment.