-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Features/protocol version flags #1090
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
Features/protocol version flags #1090
Conversation
9082c32 to
c577217
Compare
43922f2 to
a017f12
Compare
98a670a to
1b673fc
Compare
flow/Platform.cpp
Outdated
| if (!AssignProcessToJobObject( job, GetCurrentProcess() )) | ||
| TraceEvent(SevWarn, "FailedToSetMemoryLimit").GetLastError(); | ||
| #elif defined(__linux__) | ||
| #elif defined(__linux__) && !defined(USE_ASAN) |
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.
This is no longer necessary as of eacde47
flow/serialize.h
Outdated
| virtual void serializeBinaryWriter( BinaryWriter& ) const = 0; | ||
| virtual void serializePacketWriter(PacketWriter&, bool useObjectSerializer) const = 0; | ||
| virtual void serializeBinaryWriter(BinaryWriter&) const = 0; | ||
| virtual void serializeBinaryWriter(ObjectWriter&) const = 0; |
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.
serializeObjectWriter?
|
Need to test on Windows, but otherwise this is ready. |
a8fe16b to
8125bba
Compare
|
This is now compiling on Windows as well. I tested:
|
atn34
left a comment
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.
Might be a good idea to clang-format just the hunks changed in this PR with git clang-format if you haven't already
| void serialize(Ar& ar) { | ||
| ASSERT( ar.protocolVersion() >= 0x0FDB00A400040001LL ); | ||
| serializer(ar, issues, supportedVersions, connectedCoordinatorsNum, traceLogGroup, knownClientInfoID, reply, arena); | ||
| if constexpr (!is_fb_function<Ar>) { |
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.
Strange whitespace
|
|
||
| /** Strict less ordering by name of key only */ | ||
| struct KeyOrder : std::binary_function<Entry, Entry, bool> { | ||
| struct KeyOrder { |
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.
This file is one of those third-party-don't-edit-it files. Please revert these changes (I'm assuming whether or not it's a good idea to include files we shouldn't edit in source control is out of scope for this PR)
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.
If I revert this it will break the Windows build. std::binary_function was removed in C++17. So either we leave the change in or upgrade this external dependency. Fo now I will leave this in - updating SimpleIni.h should be done in a different PR.
| virtual bool validate( | ||
| std::vector<LocalityEntry> const& solutionSet, | ||
| Reference<LocalitySet> const& fromServers ) const = 0; | ||
| IReplicationPolicy() {} |
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.
If I'm reading this right these are all whitespace-only changes? Might be good to move this to a separate PR
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 can't work with this file without reformat. This file is so bad that I refuse to revert.
the clang-format file in the repository is currently very far off what the general code-style is and it mixes spaces and tabs. So I kind of gave up in that fight... |
|
test this please |
ca2ecb5 to
45e0234
Compare
|
I don't quite understand why this is failing on MacOS. I tested this on MacOS and it works fine. If your version of Xcode doesn't support C++17 I would expect a failure earlier because of an unknown |
This commit includes: - The flatbuffers implementation - A draft on how it should be used for network messages - A serializer that can be used independently What is missing: - All root objects will need a file identifier - Many special classes can not be serialized yet as the corresponding traits are not yet implemented - Object serialization can not yet be turned on (this will need a network option)
This commit includes functionality to turn on the object serializer for network communication. This is done the following way: - On incoming connections, a process will detect whether the client supports the object serializer and will only serialize responses with it, if it does - On outgoing connections, the command line flag is used to determine whether the object serializer should be used to send data. This way, a cluster can run in mixed mode. To upgrade one can upgrade one process at a time and set the flag one process at a time. This is how this is tested on the simulator: - The command line flag can take three options: on, off, and random. - For off, the object serializer will never we used. - For on, the object serializer will be always used. - For random, the simulator will flip a coin for each process it starts up.
When a process joins a cluster it fetches the cluster interface. However, not the whole interface is exposed to the client. This mechanism relies on the fact that the serializer keeps the field ordering and doesn't verify the message before parsing it. To make this work, we provide a client type with one member (the ClusterInterface which is exposed to the client and the server). This client interface has the same FileIdentifier as the ClusterControllerFullInterface which has the same first member. This works because FlatBuffers allows for members to be missing.
Currently, enabling the ObjectSerializer results in failures. These are hard to debug. Therefore I added a unit test that reproduces the problem.
Co-Authored-By: mpilman <[email protected]>
45e0234 to
5a13915
Compare
…t building via make
Add Flatbuffer To Flow Project
In order to make the code review process for flatbuffers less painful (as this will be a quite large change), I am going to make a code review early in the process so that people can take a look. The main ideas here are: