[pbs-devel] [PATCH proxmox-backup v2 3/4] datastore: data blob: increase compression throughput
Dominik Csapak
d.csapak at proxmox.com
Fri Aug 2 12:47:56 CEST 2024
On 7/31/24 16:39, Thomas Lamprecht wrote:
> Am 31/07/2024 um 11:36 schrieb Dominik Csapak:
>> For now, we have to parse the error string for that, as `zstd` maps all
>> errors as `io::ErrorKind::Other`. Until that gets changed, there is no
>> other way to differentiate between different kind of errors.
>
> FWIW, you could also use the lower-level zstd_safe's compress2 [0] here,
> compress_to_buffer is just a thin wrapper around that [1] anyway. Then you
> could match the return value to see if it equals `70`, i.e., the value of
> the ZSTD_error_dstSize_tooSmall [2] from the ZSTD_ErrorCode enum.
>
> I mean, naturally it would be much better if upstream provided a saner
> interface or at least a binding for the enum, but IME such error codes
> are quite stable if defined in this enum way, at least more stable than
> strings, so might be a slightly better workaround.
>
> [0]: https://docs.rs/zstd-safe/latest/zstd_safe/struct.CCtx.html#method.compress2
> [1]: https://docs.rs/zstd/latest/src/zstd/bulk/compressor.rs.html#117-125
> [2]: https://github.com/facebook/zstd/blob/fdfb2aff39dc498372d8c9e5f2330b692fea9794/lib/zstd_errors.h#L88
sadly AFAICS this is currently not possible
i tried this and instead of error 70 i got:
'18446744073709551546'
reading your [2] link, it also states:
> * note 1 : this API shall be used with static linking only.
> * dynamic linking is not yet officially supported.
so i don't thinks this works, unless we'd link statically?
so how do we want go forward with this?
More information about the pbs-devel
mailing list