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
sqlserver compression / encryption #1161
Conversation
@@ -72,6 +80,21 @@ func NewServer(folder storage.Folder) (*Server, error) { | |||
bs.server = http.Server{Addr: bs.endpoint, Handler: bs} | |||
bs.indexes = make(map[string]*Index) | |||
bs.leases = make(map[string]Lease) | |||
compressor, err := internal.ConfigureCompressor() | |||
if err != nil { | |||
if _, ok := err.(internal.UnknownCompressionMethodError); !ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add some warning log to notify the user that WAL-G failed to configure the compressor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
Will return error unless special builtin compression method specified.
if idx.Encryption != bs.encryption { | ||
return fmt.Errorf("blob encryption (%s) does not match configured (%s)", idx.Encryption, bs.encryption) | ||
} | ||
if idx.Compression != bs.compression { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's assume the following case: Index with some encryption configured but without compression. Server has both encryption and compression enabled. Encryption check is passed, but compressors are obviously mismatched. In this setup, WAL-G will fail to download the uncompressed encrypted file. Maybe allow this scenario (with some warnings)?
Also, maybe go even further and allow to download the file using all currently supported compressors without the requirement that it should match the currently configured one? WAL-G supports this behavior, at least in Postgres (see DownloadAndDecompressStorageFile).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing compression algorithm - one part of the problem. The second one is changing encryption.
The proper solution is to keep metainfo with files (as file extension or in some JSON) and choose decompressor/crypter by it's name. But it's not possible for the crypter at the moment.
I wouldn't like to solve only half of the problem, especially it's pretty hypothetical for the SQLServer.
71da5f3
to
84f5802
Compare
84f5802
to
a48dcec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no criminality
SQLServer
Enables WAL-G standard compression and encryption methods for SQLServer.
Option
WALG_COMPRESSION_METHOD=sqlserver
has special meaning: WAL-G will request SQLServer to compress data itself.