-
Notifications
You must be signed in to change notification settings - Fork 304
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
Determinstic compression #140
Comments
Thanks for the feedback. Yes the stateless will be deterministic. Within the same ISA-L version and using the same input and parameters, you should get the same output. If you haven't already, you may consider pre-allocating the level_buf and reusing the same buffer on subsequent compression runs. This is just for speed of course. It doesn't change the deterministic behavior of the output. Please let us know when you have finished integration. |
Great! Thanks for the prompt response. |
There is one caveat with this response, the compression output may differ if you run the compression on different cpu architectures. In order to get the best performance, algorithms are modified to obtain optimal performance based on the resources available on a given cpu architecture. |
Thanks for the response. This would be on the same machine. We use the same CPUs. It is for our recovery logic. We use write ahead logging. So runtime code generated a compressed output then the recovery logic would recompress the data. We expect the same output. So, to confirm, on the same box(same cpus) with same ISA-L version and using the same input and parameters, we should get the same output? |
Correct. |
We integrated ISAL into our database, but we are seeing non-determinism mentioned above. We are using the same box, the same ISAL version (v2.29.0 ), same parameters but we see two different compression output. The code that we are using to compress is the following
I have attached the two compressed outputs (in binary) that ISAL produced. Since the sizes are different, our recovery logic can't handle it as we are expecting the same size. Apreciate your help. Thanks |
I looked at these files. I could confirm |
Thanks for looking. No blkalloc can't fail. If it fails we will abort the thread so no compression will take place. |
Note: Since it is part of the file system, we have to align it to the sector boundary. The trailing bytes at the end can be ignored as you did. |
We are still encountering this issue. Is there a diagnostic/ debug info we can use to determine why we are getting two different outputs... Like a different strategy? |
Is it possible to dump the contents of |
Thanks Greg. We will provide the isalstream for the two cases. |
We see great results with ISAL hence we are planning on adding it to our application. One of our requirements is that we get the same compressed output if we call ISAL compress multiple times on the same payload data. With ZLIB we always get the same compressed output. Will we get the same output every time or we can get different compressed output for the same payload? Also if the compressed output is different can the length be different?
As an example first we compress payload A and get B. If we compress payload A again, will be get B again?
Case 1 :- compress (A) --> B
Case 2 (Recovery) :- compress (A) --> will be B as above?
Appreciate your help.
We use the following code to compress data
The text was updated successfully, but these errors were encountered: