-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
If the node name is longer than 28 bytes, shorten it with SHA-224 #36752
If the node name is longer than 28 bytes, shorten it with SHA-224 #36752
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.
Thanks
@mmusgrov you're welcome 🙂 |
This comment has been minimized.
This comment has been minimized.
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.
Since approving the PR I've received some concerns about this change. The requests are:
- to change the log message from info to warn
- to ask users to opt into the change via a config property that controls whether or not shortening of the node id should be allowed
In addition, we have a similar problem in WildFly and Narayana so I will start a discussion in the narayana-users forum about adding the feature to Narayana so that all runtimes can benefit from the change.
So... should I implement those changes, or do we want to wait for the result of the discussion? |
Personally I'd say that the only one up for debate is the default value for the property. If the default is to fail the boot, the current behaviour, then the user will detect the issue during the commissioning phase so I'd maybe lean a little in that direction, besides, it would minimise surprise for existing users. Let's give people a couple of days to respond and if nothing is forthcoming then we should decide. |
I agree with Mike. I think that the default behaviour of the property is to fail the boot. If user want to change this behaviour they need to change the value of the property, in this way they will be aware that the 'node name' might change (when longer than 28 bytes) from the expected one because it will be shorten with SHA-224. |
e29d3a8
to
07b3a4c
Compare
@mmusgrov I added the changes (they were minimal). The property name is of course up to debate, but the change is trivial. |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
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.
Looks great.
@turing85 There were no comments on the message that I posted to the narayana google users group so I think this is ready for merging.
Okay, then all that is left to do is an approval (github still says that merging is blocked and that an approval is needed). @maxandersen Can you approve this one? |
Thanks! |
* @see #nodeName | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
public boolean shortenNodeNameIfNecessary; |
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.
How about naming it truncateNodeName
or simply shortenNodeName
? The ifNecessary
makes my chin itch a bit 😀
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.
How about making it true by default as a precaution?
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 not truncation. Truncate is rather abrupt/finite in nature.
maybe compress as this will be a lossy-but-hopefully-not-significant-compression ?
btw. why the "ifNecessary" part ? if its necessary why is it not true by default?
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.e. since this seems necessary I would argue it should be default on and possible to turn off. At least in main with good release note metnion - if this was for LTS branch I could see how one could argue it should stay off.
Am I missing something?
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 not truncation. Truncate is rather abrupt/finite in nature.
maybe compress as this will be a lossy-but-hopefully-not-significant-compression ?
Right, compress
makes more sense
btw. why the "ifNecessary" part ? if its necessary why is it not true by default?
+1
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.
How about naming it
truncateNodeName
or simplyshortenNodeName
? TheifNecessary
makes my chin itch a bit 😀
@gastaldi @maxandersen
"if necessary" because the shortening takes play if and only if the node-name is longer thank 28 bytes. I know that it is unwieldy. This is why I explicitly said the name is up for discussion.
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.
Maybe it's less unlikely to happen, but would truncating be a problem if the algorithm isn't available?
Hard to say. This depends how the node names are constructed. If one has long names and a common prefix, then this might lead to name duplication.
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.
btw. why the "ifNecessary" part ? if its necessary why is it not true by default?
Historically the default is to fail startup if the nodeIdentifier, set by the user or the platform, is too long. Since the use of a hash incurs the risk of collisions and can result in non ACID behaviour it should not be the default - the user has to opt in to the added risk of using a hash since only they can quantify the risk to their application.
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.
ok, how about simply "hashNodeNameIfNecessary" or simply "hashNodeName" which still will only happen if needed but with hash it at least signals what happens and collision awareness could be necessary.
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.
"hashNodeName" sounds reasonable, the docs will let the user know what effect it will have.
Resolves #30491