-
Notifications
You must be signed in to change notification settings - Fork 54
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
Integer fields in gzip_index are serialized independently to endianness #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to say this, but the endian wars are over. The bad guys won. Quoting the FlatBuffers documentation:
Each scalar is also always represented in little-endian format, as this corresponds to all commonly used CPUs today. FlatBuffers will also work on big-endian machines, but will be slightly slower because of additional byte-swap intrinsics.
We should canonicalize to little-endian, not big-endian. That way these will all be nops on (Linux, Windows) x (x86, ARM).
But speaking of FlatBuffers, this problem would go away if we were modeling the gzip_index data in the fbs file instead of treating it as a binary blob. Should we do that?
ef3d562
to
49286f7
Compare
Signed-off-by: Viktor Kuznietsov <vkuzniet@amazon.com>
49286f7
to
3bcc44e
Compare
I think, long term this is the right approach. We would anyway needed to do that at the time we re-write the indexer to Go, so this work seems to be inevitable. |
Created an issue #81 to address that. Once it's implemented, encode/decode methods from this PR will be obsolete. |
Signed-off-by: Viktor Kuznietsov vkuzniet@amazon.com
Issue #, if available:
Description of changes:
gzip_index
'shave
,size
andspan_size
as well asgzip_index_point
'sin
,out
fields are converted to Big Endian representations for serialization and are converted back to the hosts architecture upon consumption. This ensures thatIndexByteData
byte sequence is consistent across multiple architectures.Testing performed:
make test && make check && make integration
passsoci
andsoci-snapshotter-grpc
to EC2 instance and ran container workload forrabbitmq
in lazy loading mode and got successful execution.All the layers on rabbitmq were lazily loaded.
The workload completed successfully.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.