-
Notifications
You must be signed in to change notification settings - Fork 4.1k
storageccl: Don't update file registry when unencrypted files are created #65430
Description
Currently, encryptedFS in pkg/ccl/storageccl/engineccl/ uses the same
logic to add newly-created files to the file registry map (and marshal it
and sync it to disk), whether the file was actually encrypted or not. If
the map is large, this adds a lot of overhead to just add empty entries
to the map and to marshal/sync the whole map to disk, which causes
performance issues even if encryption gets disabled by setting new-key=plain
in the encryption options.
Non-encrypted files are created with an active key with
key.Info == EncryptionType_Plaintext. When this is
the case, SetFileEntry should be a no-op (or should not
get called in encryptedFS.Create), and GetFileEntry
should treat the file as plaintext (which it already does).
This brings the encryptedFS behaviour in line with
what is already in the encryption-at-rest RFC: