Skip to content

storageccl: Don't update file registry when unencrypted files are created #65430

@itsbilal

Description

@itsbilal

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:

https://github.com/cockroachdb/cockroach/pull/19785/files#diff-54ee9bff5118bc191353c52538d3d10ea1bda03aba0335623017cd2dd87153b8R450

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-storageRelating to our storage engine (Pebble) on-disk storage.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.C-performancePerf of queries or internals. Solution not expected to change functional behavior.N-followupNeeds followup.O-postmortemOriginated from a Postmortem action item.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions