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

libroach/engine: plumb support for SingleDelete operation #33440

Merged

Conversation

nvanbenschoten
Copy link
Member

Informs #8979.

This commit doesn't actually use the operation yet, but any experiments
will require this plumbing, so it made sense to pull it out and properly
test it.

Release note: None

@nvanbenschoten nvanbenschoten requested review from benesch, tbg and a team January 2, 2019 18:21
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 13 of 13 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


c-deps/libroach/batch.cc, line 89 at r1 (raw file):

      break;
    }
    case rocksdb::kSingleDeleteRecord:

Can you give more detail on the outcome here? Does this mean that after a SingleDelete, the "deleted" value remains visible? I see that the code is simple in this case, but is this really sane?


c-deps/libroach/batch.cc, line 91 at r1 (raw file):

    case rocksdb::kSingleDeleteRecord:
      // These semantics don't quite mirror SingleDelete's expected
      // implementation, but they don't violate the its contract from

the its


pkg/storage/engine/rocksdb.go, line 796 at r1 (raw file):

}

// Clear removes the most recent item from the db with the given key.

SingleClear

@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/singleDelPlumb branch from 6492023 to cfc001a Compare January 2, 2019 21:15
Copy link
Member Author

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


c-deps/libroach/batch.cc, line 89 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

Can you give more detail on the outcome here? Does this mean that after a SingleDelete, the "deleted" value remains visible? I see that the code is simple in this case, but is this really sane?

Done. It actually means that the SingleDelete is treated like a standard Delete operation (we're in C++, so the fallthrough is implicit).


c-deps/libroach/batch.cc, line 91 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

the its

Done.


pkg/storage/engine/rocksdb.go, line 796 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

SingleClear

Done.

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained


c-deps/libroach/batch.cc, line 89 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Done. It actually means that the SingleDelete is treated like a standard Delete operation (we're in C++, so the fallthrough is implicit).

Ah, makes sense, thanks.


c-deps/libroach/batch.cc, line 92 at r2 (raw file):

      // Treating a SingleDelete operation as a standard Delete doesn't
      // quite mirror SingleDelete's expected implementation, but it
      // don't violate the operation's contract:

nit: doesn't ;-)

Informs cockroachdb#8979.

This commit doesn't actually use the operation yet, but any experiments
will require this plumbing, so it made sense to pull it out and properly
test it.

Release note: None
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/singleDelPlumb branch from cfc001a to 45c072a Compare January 2, 2019 22:34
Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

I really dislike how we translate from Clear -> Delete when going from CRDB to RocksDB. Peer ack for whoever fixes this.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

Copy link
Member Author

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

bors r+

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)


c-deps/libroach/batch.cc, line 92 at r2 (raw file):

Previously, tbg (Tobias Grieger) wrote…

nit: doesn't ;-)

lol, that don't sound wrong to me... done.

@nvanbenschoten
Copy link
Member Author

I really dislike how we translate from Clear -> Delete when going from CRDB to RocksDB.

I was talking to @benesch about this today. I guess the idea is that in CRDB code "delete" implies MVCC-awareness (i.e. leaving tombstones) while "clear" doesn't. I don't really like it either so if you're on board I'd happily switch it over. Just give the 👍.

@petermattis
Copy link
Collaborator

I was talking to @benesch about this today. I guess the idea is that in CRDB code "delete" implies MVCC-awareness (i.e. leaving tombstones) while "clear" doesn't. I don't really like it either so if you're on board I'd happily switch it over. Just give the 👍.

The current situation is very confusing. DeleteRange in CRDB should correspond to DeleteRange in RocksDB. If we need a term for laying down tombstones on a range, it shouldn't be Delete.

@craig
Copy link
Contributor

craig bot commented Jan 2, 2019

Merge conflict (retrying...)

craig bot pushed a commit that referenced this pull request Jan 2, 2019
33436: cli/interactive_tests: unskip test_url_db_override r=knz a=knz

Fixes #30796.

... and use a more clearly guaranteed-bad DNS name for the expected
failure. Suggested by @petermattis.

Release note: None

33440: libroach/engine: plumb support for SingleDelete operation r=nvanbenschoten a=nvanbenschoten

Informs #8979.

This commit doesn't actually use the operation yet, but any experiments
will require this plumbing, so it made sense to pull it out and properly
test it.

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
Co-authored-by: Nathan VanBenschoten <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jan 2, 2019

Build succeeded

@craig craig bot merged commit 45c072a into cockroachdb:master Jan 2, 2019
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/singleDelPlumb branch January 3, 2019 16:10
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

Successfully merging this pull request may close these issues.

4 participants