-
Notifications
You must be signed in to change notification settings - Fork 89
Fix data optimization when compression is disabled #6192
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
Conversation
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.
@romayalon Notice that config.CHUNK_CODER_COMPRESS_TYPE is only a default value, but each chunk actually refers to a chunk_coder (a DB collection) where we define the compress_type configuration which applies to that chunk. This is meant to provide flexibility to have chunks with different compression types in the same system or bucket (for example disable compression for already-compressed media files, or switch to another compression).
So I think we should fix it in map_aggregate_chunks() to use size if compress_size is unset - this makes sense because when a chunk used "no" compression then freely speaking the compressed size is the same as size, it's just that we didn't store it in the DB. This fix should keep everything else intact and also account compress_size correctly for when we disable compression altogether.
WDYT?
function map_aggregate_chunks() {
const compress_size = this.compress_size || this.size;
emit(['', 'compress_size'], compress_size);
emit([this.bucket, 'compress_size'], compress_size);
}7249745 to
9037d75
Compare
|
@guymguym agreed and fixed. |
Signed-off-by: Romy <romy2232@gmail.com>
9037d75 to
2b55904
Compare
|
@guymguym @nimrod-becker @romayalon |
| */ | ||
| function map_aggregate_chunks() { | ||
| const compress_size = this.compress_size || this.size; | ||
| emit(['', 'compress_size'], this.compress_size); |
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.
@romayalon use compress_size here too
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.
and not this.compress_size...
FYI @nimrod-becker
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.
ah!
|
@jeniawhite Right. |
|
@guymguym |
Signed-off-by: Romy romy2232@gmail.com
Explain the changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: