Skip to content

reappearing "ghost" key after 17 steps #50

@cmumford

Description

@cmumford

Original issue 44 created by josephwnorton on 2011-10-03T16:13:29.000Z:

I'm testing an Erlang-based API for leveldb via an Erlang NIF written in C++. The test model is written in Erlang with the help of the test tool QuickCheck. The test model and test tool have found a failing minimal test case of 17 steps that appears (but not proven yet) to be an issue with leveldb.

I tried to manually create a minimal failing example that in pure C++. Unfortunately, I am unable to reproduce the issue with a pure C++ test case.

I attached the failing counterexample case and leveldb data directory after closing of the database. I'm hoping the leveldb authors might be able to pinpoint the issue or provide some instructions on how to troubleshoot this issue.

What steps will reproduce the problem?

  1. open new database
  2. put key1 and val1
  3. close database
  4. open database
  5. delete key2
  6. delete key1
  7. close database
  8. open database
  9. delete key2
  10. close database
  11. open database
  12. put key3 and val1
  13. close database
  14. open database
  15. close database
  16. open database
  17. seek first

What is the expected output? key3 at step 17

What do you see instead? key1 at step 17

> foobar:test().

<<10,0,0,0,12>>/'$end_of_table': [{obj,6,0}]

'$end_of_table'/'$end_of_table': []

'$end_of_table'/'$end_of_table': []

<<18,193,216,96,0,8>>/'$end_of_table': [{obj,6,0}]

<<18,193,216,96,0,8>>/'$end_of_table': [{obj,6,0}]

<<10,0,0,0,12>>/<<18,193,216,96,0,8>>: [{obj,6,0},{obj,6,0}]
ok

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

commit 26db4d9
Author: Hans Wennborg <hans@chromium.org>
Date: Mon Sep 26 17:37:09 2011 +0100

The issue repeats on MacOS X Lion and Fedora 15.

Please provide any additional information below.

The following shutdown sequence is performed at the time of closing the database:

leveldb::WriteOptions db_write_options;
leveldb::WriteBatch batch;
leveldb::Status status;

db_write_options.sync = true;
status = h-&gt;db-&gt;Write(db_write_options, &amp;batch);
if (!status.ok()) {
    return MAKEBADARG(env, status);
}

delete h-&gt;db;
h-&gt;db = NULL;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions