-
Notifications
You must be signed in to change notification settings - Fork 70
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
change RMW_GID_STORAGE_SIZE from 24 to 16 #328
Conversation
Signed-off-by: Brian Chen <brian.chen@openrobotics.org>
Just my opinion, but that doesn't really seem like a great reason to change the GID size. RMW isn't just Cyclone DDS + Fast RTPS + Connext DDS, or DDS for that matter. |
Test regressions introduced by this PR resolved in ros2/rmw_dds_common#63 |
@christophebedard It would also be inconsistent to have Taking a step back it seems like a good idea to "rip the bandaid off" now to force consistency in |
I see, that makes sense. Thanks for the explanation @ihasdapie. |
While I agree with your reasoning in general, I do think it would be worthwhile to take a look at the non-core rmw implementations to see if any of them are making assumptions about the current size of Once we know what assumptions are out there, we can make a decision on a way forward. |
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.
lgtm
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.
LGTM, but I'd like other members of @ros2/team to review as well.
I think it's important to point out that the I would even go so far as to say it is incorrect to try and put the contents of a The old OpenSplice GID did contain reversible information I think, e.g. like the domain or host information was part of it I think. Now that may not be a good idea or practical, but it is an example of how it differs semantically from UUIDs. So if that is the main concrete motivation for changing the size of this, then I would push back on that. That being said, changing the size back to 16-bytes is fine with me, if that works for all of the rmw implementations out there, but even if we do that "casting" it into a UUID isn't a good ideal still, at least in my mind. |
To further my point,
Well a UUID is 128-bit and that's part of what makes it "universal" is the size of it (which allows it to be practically unique due to the space of numbers from which you're selecting one randomly). And if the "uid" iceoryx is creating is stored in only a 64-bit space then it cannot have the same guarantees that people assume from a UUID. My point being, it would be misleading to take this value and advertise it as a UUID. Because anyone consuming it cannot safely make assumptions about it as if it were a UUID. |
@wjwwood Your distinction between a GID and a GUID (or UUID) makes sense to me. I guess it was confusing because all of the default rmw's use the term "guid", and explicitly convert those identifiers to "gid" when implementing the rmw API. Also, the identifier for service request writers are represented as a 16 byte "guid" here: Line 359 in b9036d4
and when we decided to add a getter for this identifier we decided to store it in a All of this is motivated by the new service introspection feature, which aims to use the service client identifier to track request-response pairs over time. Ultimately, we just need to know the length of that identifier (16 or 24 bytes), we don't care if it is globally unique. |
It seems like changing this line: Line 359 in 2259c3f
to rmw_gid_t writer_gid; is the more appropriate change to make (instead of this PR). Though it seems a lot more disruptive. |
I think the crux of the problem is that Another argument for why it doesn't make sense to force dds to provide a I think the right choice to make would be to either implement Jacob's suggestion to nest a uint8_t writer_gid[RMW_GID_STORAGE_SIZE]; Either way it'll involve the awfully tedious task of opening a bunch of small PRs to change that |
We decided that while we could shrink this to 16 bytes, there isn't really a need to do so. There may be RMWs in the future that need extra bytes. We do recognize that there are some possible inconsistencies in the current code, so we should have an issue for that and fix those. Because of all of that, closing this. |
RMW_GID_STORAGE_SIZE
is#define
'd to be 24 bytes long but the GUID is 16 bytes for all currently supported RMW implementations. The reason why it is 24 bytes long is likely due to the now-legacyrmw_opensplice
. (Introduced in f45e4ce for the content filtering feature #35)From my understanding the last 8 bytes are never checked outside of a few tests.
ConnextDDS
https://github.com/ros2/rmw_connextdds/blob/79b037561a9e8a719cab6fea2b128c600ccd7113/rmw_connextdds_common/src/common/rmw_impl.cpp#L2120-L2104
CycloneDDS
https://github.com/eclipse-cyclonedds/cyclonedds/blob/0e2cd3e303be2171dd0e4fc685cc5031f70b0f52/src/core/ddsc/include/dds/dds.h#L192-L184
https://github.com/ros2/rmw_cyclonedds/blob/35c63e2dc30b9f58e3aa4a41f428310aff0cef83/rmw_cyclonedds_cpp/src/rmw_node.cpp#L808-L800
FastRTPS
GUID_t
contains a prefix (12 bytes) and entity id (4 bytes) for a total of 16 bytes.https://github.com/eProsima/Fast-DDS/blob/e9e933b7dc4d78d59f6cf714fadbde9c62a1119e/include/fastdds/rtps/common/Guid.h#L44-L42
Knocking
RMW_GID_STORAGE_SIZE
down to 16 bytes (which is standardized as 16 octets) would also makermw_gid_t
consistent withrmw_request_id_t
which contains a 16 byte uuid.rmw/rmw/include/rmw/types.h
Lines 356 to 363 in 2259c3f
Signed-off-by: Brian Chen brian.chen@openrobotics.org