set snappy compression only when supported (#4325)
Summary: Right now `OptimizeLevelStyleCompaction` may set compression type to Snappy even when Snappy is not supported, this may cause errors like "no snappy compression support" Fixes https://github.com/facebook/rocksdb/issues/4283 Pull Request resolved: https://github.com/facebook/rocksdb/pull/4325 Differential Revision: D15125542 Pulled By: miasantreble fbshipit-source-id: 70890b73ababe16752721555dbd290633c2aafac
This commit is contained in:
parent
4479dff208
commit
d51eb0b583
@ -548,7 +548,10 @@ ColumnFamilyOptions* ColumnFamilyOptions::OptimizeLevelStyleCompaction(
|
||||
if (i < 2) {
|
||||
compression_per_level[i] = kNoCompression;
|
||||
} else {
|
||||
compression_per_level[i] = kSnappyCompression;
|
||||
compression_per_level[i] =
|
||||
LZ4_Supported()
|
||||
? kLZ4Compression
|
||||
: (Snappy_Supported() ? kSnappyCompression : kNoCompression);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user