-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(repository): Add support to configure metadata compression algorithm #550
Conversation
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
Add unit tests Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
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.
One minor suggestion, but +1 from me apart from that
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
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.
According to the PR description, you performed a manual end-to-end test to verify that the setting was applied and had an effect.
Can you please add an automated test for those steps?
Also, see inline questions.
🥇Thanks for doing this.
repo/content/content_manager_test.go
Outdated
@@ -2403,6 +2405,13 @@ func (s *contentManagerSuite) newTestContentManager(t *testing.T, st blob.Storag | |||
return s.newTestContentManagerWithTweaks(t, st, nil) | |||
} | |||
|
|||
func (s *contentManagerSuite) newTestContentManagerWithMetadataCompression(t *testing.T, st blob.Storage, comp compression.Name) *WriteManager { |
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.
Is comp
used?
I wonder why it was not flagged by a linter. 🤔
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.
This function is not used anymore, I forgot to cleaned it up. I've removed this
MaxPackSize int `json:"maxPackSize,omitempty"` // maximum size of a pack object | ||
IndexVersion int `json:"indexVersion,omitempty"` // force particular index format version (1,2,..) | ||
EpochParameters epoch.Parameters `json:"epochParameters,omitempty"` // epoch manager parameters | ||
MetadataCompression compression.Name `json:"metadataCompression,omitempty"` // metadata compression algorithm name |
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.
The approach implemented in this PR is to have a repo-wide setting in MutableParameters
.
Does it make sense to make this a policy setting instead?
Are there any tradeoffs in doing so? and which ones?
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.
The main disadvantage was the implementation and testing complexity. Since this feature is not expected to be used frequently (applicable only to special cases), we decided to go with the easiest option which will be quicker to implement. We don't need to set metadata compression settings per file. It's applicable for the whole repo instead of the file level.
Signed-off-by: Prasad Ghangal <prasad.ganghal@veeam.com>
Closing in respect of #556 |
Overview
This PR:
MetadataCompression
to set the compression algorithm for metadataMetadataCompression
can be set usingkopia repository set-parameters --metadata-compression=<name>
none
zstd-fastest
by default for newly created repo""
, the default compressionzstd-fastest
is used.Test plan
Metadata compression setting on the existing repository
Metadata compression setting on a new repository