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

Snapshot not recognized for sqn_order fold? #21

Open
ThomasArts opened this issue Feb 14, 2019 · 1 comment
Open

Snapshot not recognized for sqn_order fold? #21

ThomasArts opened this issue Feb 14, 2019 · 1 comment

Comments

@ThomasArts
Copy link
Member

ThomasArts commented Feb 14, 2019

The following test case is suspicious, because even though we fold with snapshot true we don't seem to get the keys from only the snapshot.

leveledjc_eqc:init_backend(o_rkv,
    [{root_path, Dir}, {log_level, error}, {max_sstslots, 2},
     {cache_size, 10}, {max_pencillercachesize, 40},
     {max_journalsize, 20000}],
    sut) ->
  <0.2667.0>
leveledjc_eqc:put(<0.2667.0>, <<98, 117, 99, 107, 101, 116, 51>>,
    <<227, 142, 0, 237, 130, 199, 37, 238, 62, 225, 139, 160, 158,
      68, 105, 142>>,
    <<53, 1, 0, 0, 0, 43, 131,....>>,
    [], o_rkv) ->
  ok

Normal start, putting 1 object. Note that object has 43 and 131 in it to distinguish it later on.
Then:

leveledjc_eqc:objectfold(<0.2667.0>, o_rkv, {#Fun<leveledjc_eqc.30.5533705>, []},
    true, sqn_order, 4) ->
  #Fun<leveled_runner.10.98249213>
leveledjc_eqc:put(<0.2667.0>, <<98, 117, 99, 107, 101, 116, 51>>,
    <<227, 142, 0, 237, 130, 199, 37, 238, 62, 225, 139, 160, 158,
      68, 105, 142>>,
    <<53, 1, 0, 0, 0, 78, 131,...>>, [], o_rkv) -> ok

Start an object fold in sequence order with SNAPSHOT true! After that, with same bucket and key add a new object. Note the 78, 131 there.
If we now run the fold, the implementation returns:

leveledjc_eqc:fold_run(4, #Fun<leveled_runner.10.98249213>) ->
  [{<<98, 117, 99, 107, 101, 116, 51>>,
    <<227, 142, 0, 237, 130, 199, 37, 238, 62, 225, 139, 160, 158,
      68, 105, 142>>,
    <<53, 1, 0, 0, 0, 78, 131,...>>},
    {<<98, 117, 99, 107, 101, 116, 51>>,
    <<227, 142, 0, 237, 130, 199, 37, 238, 62, 225, 139, 160, 158,
      68, 105, 142>>,
    <<53, 1, 0, 0, 0, 43, 131, ...>>}]

Thus both objects. This surprises me a bit, I had expected to only get the object back from the snapshot moment.

@martinsumner
Copy link

martinsumner#261

There is an eunit test leveled_bookie:sqnorder_mutatefold_test/0 that recreates the problem, and now passes after the change.

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

No branches or pull requests

2 participants