-
Notifications
You must be signed in to change notification settings - Fork 155
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
[leo_object_storage] More strictly checking the header, less file:pread(s) for reading a body #527
Comments
I've recognized this issue, every item should be checked to avoid remaining a broken object in a container I think. |
UPDATE: Fixed clock to 4633552912011362 as it's not unix timestamp/microsec but the erlang specific one check specification in details
@yosukehara could you check the above spec? |
@mocchira Thanks for summarizing the check items. We actually use
|
@yosukehara thanks. https://github.com/leo-project/leo_storage/blob/develop/src/leo_sync_remote_cluster.erl#L349 with length(CMeta) == 2048 should be the upper limit. |
(storage_0@127.0.0.1)3> R = leo_object_storage_transformer:list_to_cmeta_bin([
(storage_0@127.0.0.1)3> {cluster_id, hoge},
(storage_0@127.0.0.1)3> {num_of_replicas, 3},
(storage_0@127.0.0.1)3> {udm, crypto:rand_bytes(2048)}
(storage_0@127.0.0.1)3> ]).
<<131,108,0,0,0,4,104,2,100,0,10,99,108,117,115,116,101,
114,95,105,100,100,0,4,104,111,103,101,104,...>>
(storage_0@127.0.0.1)4> byte_size(R).
2122
(storage_0@127.0.0.1)5> so I'd like to choose 4096 for safe. |
@yosukehara |
Skipping time has gotten around 2x faster than the 1.3.0 by this fix. |
As there are only two checks (timestamp, dsize) for converting a binary to a header,
In many case unnecessary file:pread to retrieve its body happen during skipping a garbage.
These can be relaxed by checking the header more strictly ( like checking every fields ) .
The text was updated successfully, but these errors were encountered: