Repository navigation
ZOOKEEPER-5113: Audit log keys, mntr peer_state and admin zabstate are lower-cased with the JVM default locale - #2481
Open
sharanggupta wants to merge 1 commit into
Conversation
…e lower-cased with the JVM default locale
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/ZOOKEEPER-5113
Several machine-read strings in zookeeper-server are produced with
String.toLowerCase()and noLocale, so they follow the JVM default locale. Under a Turkish default locale (tr-TR) anIbecomes a dotlessı(U+0131):AuditEvent: the audit log keyssession=,ip=,operation=becomesessıon=,ıp=,operatıon=, andResult.INVOKEDbecomesresult=ınvoked(reproduced against 3.9.6 throughZKAuditProvider.log(...));getValue(FieldName)keeps working only because it folds the key the same wrong way.AuditHelper.getCreateMode:znode_type=contaıner,persıstent_sequentıal, ...Commands(zabstate) andQuorumPeer.getDetailedPeerState()(zk_peer_stateinmntr//commands/monitor):electıon,dıscovery,synchronızatıon,followıng,observıng.QuorumPeer.QuorumServer.getType: thepeerTypeconfig switch, same fold.This uses
Locale.ROOTat those sites, matchingZKHostnameVerifier(PrepRequestProcessorpinsLocale.ENGLISHfor the same reason).AuditEventTest#testFormatRegardlessOfDefaultLocalesets atr-TRdefault locale (restored infinally) and asserts the documented key names; it fails before the change and passes after.