From: Dominik Csapak <d.csapak@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 3/4] datastore: data blob: increase compression throughput
Date: Fri, 2 Aug 2024 14:38:59 +0200 [thread overview]
Message-ID: <16cff3a6-15c3-4078-ba1b-2764e8287478@proxmox.com> (raw)
In-Reply-To: <ba577e57-cc74-428a-90ea-f298f3b81a03@proxmox.com>
On 8/2/24 13:59, Thomas Lamprecht wrote:
> On 02/08/2024 12:47, Dominik Csapak wrote:
>> 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.
>
> That just sounds wrong... but oh well.
>
>> so i don't thinks this works, unless we'd link statically?
>>
>
> I mean, the library can obviously translated the error to some meaningful
> string. I mean that could be due to relying on internal compiled stuff that
> we cannot use, but while I think that is a solid guess, I'd still evaluate
> how it actually works to be sure.
>
>> so how do we want go forward with this?
>
>
> If, after checking, this really seems to be unfeasible then lets go for
> the string comparison with a TODO/FIXME comment point out why it's done
> that way and that one might want to reevaluate if still required (in the
> future)
mhmm zstd just calls this:
---
fn map_error_code(code: usize) -> io::Error {
let msg = zstd_safe::get_error_name(code);
io::Error::new(io::ErrorKind::Other, msg.to_string())
}
---
which calls this:
---
pub fn get_error_name(code: usize) -> &'static str {
unsafe {
// Safety: assumes ZSTD returns a well-formed utf8 string.
let name = zstd_sys::ZSTD_getErrorName(code);
c_char_to_str(name)
}
}
---
which is part of the zstd api and at the end it maps the error code like this:
---
ERR_STATIC ERR_enum ERR_getErrorCode(size_t code) { if (!ERR_isError(code)) return (ERR_enum)0;
return (ERR_enum) (0-code); }
---
with that result, it maps the code to a string...
which matches what i get, since
2^64 - 70 = 18446744073709551546 [0]
but, i'm really not sure if we could rely in that since the function is in a 'error_private.c' which
seems to me like it's an implementation detail only?
0: https://www.wolframalpha.com/input?i=2%5E64+-+70
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-08-02 12:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 9:36 [pbs-devel] [PATCH proxmox-backup v2 0/4] improve " Dominik Csapak
2024-07-31 9:36 ` [pbs-devel] [PATCH proxmox-backup v2 1/4] remove data blob writer Dominik Csapak
2024-07-31 9:36 ` [pbs-devel] [PATCH proxmox-backup v2 2/4] datastore: test DataBlob encode/decode roundtrip Dominik Csapak
2024-07-31 9:47 ` Lukas Wagner
2024-07-31 9:50 ` Dominik Csapak
2024-07-31 9:36 ` [pbs-devel] [PATCH proxmox-backup v2 3/4] datastore: data blob: increase compression throughput Dominik Csapak
2024-07-31 14:39 ` Thomas Lamprecht
2024-08-01 6:55 ` Dominik Csapak
2024-08-02 10:47 ` Dominik Csapak
2024-08-02 11:59 ` Thomas Lamprecht
2024-08-02 12:38 ` Dominik Csapak [this message]
2024-08-07 15:01 ` Thomas Lamprecht
2024-07-31 9:36 ` [pbs-devel] [PATCH proxmox-backup v2 4/4] datastore: DataBlob encode: simplify code Dominik Csapak
2024-08-05 9:33 ` [pbs-devel] [PATCH proxmox-backup v2 0/4] improve compression throughput Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16cff3a6-15c3-4078-ba1b-2764e8287478@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=t.lamprecht@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox