TileDB
TileDB copied to clipboard
Refactor repeated encryption get stanza
Refactor 6 almost identical code sequences that are used in storage_manager.cc
and array.cc
, also in the new Group API, into an external function.
Notes to the reviewers: It might be that the decisions I took below might alter some corner cases I failed to see, backward compatibility, etc. So please read the notes below.
- The refactored code is missing
assert
s that were present in the original code. This version returns Status codes when things go sideways whilst reading the encryption configuration. - I altered a test case that was failing for me.
The test case sets
"sm.encryption_key"
to"0"
, but a comment two lines above saysCheck ok with null key
. The test case was failing for me because "0" has a length of 1, which is an invalid length for an encryption key, so the new function returned an error Status. With the original code, the test was not failing because "0" was being detected as an invalid-length key, but no error was being returned, the code was running the rest of the function withencryption_key=nullptr
andkey_length=0
. I'm not sure what's the expected behavior here, I altered the test case because it seemed like a mistake to me.
TYPE: IMPROVEMENT DESC: Refactor repeated encryption get stanza
This pull request has been linked to Shortcut Story #16063: Refactor repeated encryption get stanza in storage_manager.cc.
Stale draft, closing until revisit.