Skip to content

Conversation

@mberhault
Copy link
Contributor

This is important when encryption is enabled as we need to make sure we
handle file metadata properly.
While os.Remove will leave cruft behind, os.Link won't copy the file
encryption settings from the original and will therefore make it
unreadable.

This fixes RESTORE which writes file to local disk using local
encryption settings then ingests them. The link bypassed the rocksdb Env
leaving the ingested file without any encryption settings attached (aka:
plaintext).

Release note: None

@mberhault mberhault requested review from a team and bdarnell June 29, 2018 14:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mberhault
Copy link
Contributor Author

At some point, I need to go through all uses of the os package (there's no reason to use os.Stat when we use eng for everything else). I also need much better coverage of various features with encryption enabled. For now, I'm just trying to get tpcc to run.

@mberhault mberhault mentioned this pull request Jun 29, 2018
29 tasks
@mberhault mberhault force-pushed the marc/fix_ingest_with_encryption branch 2 times, most recently from efedcaa to b1851ba Compare July 3, 2018 08:52
Copy link
Contributor

@bdarnell bdarnell left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@mberhault
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 5, 2018

Build failed

This is important when encryption is enabled as we need to make sure we
handle file metadata properly.
While `os.Remove` will leave cruft behind, `os.Link` won't copy the file
encryption settings from the original and will therefore make it
unreadable.

This fixes `RESTORE` which writes file to local disk using local
encryption settings then ingests them. The link bypassed the rocksdb Env
leaving the ingested file without any encryption settings attached (aka:
plaintext).

Release note: None
@mberhault mberhault force-pushed the marc/fix_ingest_with_encryption branch from b1851ba to 48b5af5 Compare July 5, 2018 05:46
@mberhault
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Jul 5, 2018
27075: storage: use engine for os-level operations. r=mberhault a=mberhault

This is important when encryption is enabled as we need to make sure we
handle file metadata properly.
While `os.Remove` will leave cruft behind, `os.Link` won't copy the file
encryption settings from the original and will therefore make it
unreadable.

This fixes `RESTORE` which writes file to local disk using local
encryption settings then ingests them. The link bypassed the rocksdb Env
leaving the ingested file without any encryption settings attached (aka:
plaintext).

Release note: None

27087: roachtest: disable encryption on tests that can't handle it. r=mberhault a=mberhault

Two cases make encryption always fail:
- old versions (<= 2.0)
- uses of debug commands that open the rocksdb instance (needs
  encryption flags)

Release note: None

Co-authored-by: marc <marc@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Jul 5, 2018

Build succeeded

@craig craig bot merged commit 48b5af5 into cockroachdb:master Jul 5, 2018
@mberhault mberhault deleted the marc/fix_ingest_with_encryption branch July 5, 2018 14:38
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.

3 participants