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

oen advice about snapshot #176

cmumford opened this issue Sep 9, 2014 · 1 comment

oen advice about snapshot #176

cmumford opened this issue Sep 9, 2014 · 1 comment


Copy link

cmumford commented Sep 9, 2014

Original issue 170 created by wangtengchao on 2013-05-15T11:37:30.000Z:

What steps will reproduce the problem?
1.all code adn information showed in the additional information

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
leveldb 1.9 fedora17

Please provide any additional information below.

    const leveldb::Snapshot* snap_shot = db->GetSnapshot();
    leveldb::ReadOptions read_options;
    // change "key0"'s value from "value0" to "new"
    string val;
    cout<<"no snapshot value: "<<val<<endl;//output " new" . 
    read_options.snapshot = snap_shot;
    cout<<"snapshot value: "<<val<<endl;//output "value0" . 

    // release snapshot

    cout<<"after release snapshot: "<<val<<endl;
    //output "value0" !!! It's wrong

If i release the snapshot ,i should get the newest infomation.
But only i add the "read_options.snapshot = NULL; " after db->ReleaseSnapshot(...) anually,can i get the right result---output "new".

I deep into the code in and know it will judge "options.snapshot!=NULL" when call NewIterator(...) and Get(...) .
SO I think set the read_options.snapshot=NULL in DB::ReleaseSnapshot() is a good idea. Or you should modify the document clearly and add "read_options.snapshot = NULL;" to the example in the Snapshots part of

@cmumford cmumford self-assigned this Sep 9, 2014
Copy link
Contributor Author

Several year old question. I'm assuming either answered or no longer needed.

maochongxin pushed a commit to maochongxin/leveldb that referenced this issue Jul 21, 2022
Add aarch64 support to src/cycleclock.h.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant