Skip to content

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
apache:masterfrom
sharanggupta:ZOOKEEPER-5113-audit-mntr-locale-root
Open

sharanggupta wants to merge 1 commit into
apache:masterfrom
sharanggupta:ZOOKEEPER-5113-audit-mntr-locale-root

Conversation

@sharanggupta

Copy link
Copy Markdown

https://issues.apache.org/jira/browse/ZOOKEEPER-5113

Several machine-read strings in zookeeper-server are produced with String.toLowerCase() and no Locale, so they follow the JVM default locale. Under a Turkish default locale (tr-TR) an I becomes a dotless ı (U+0131):

  • AuditEvent: the audit log keys session=, ip=, operation= become sessıon=, ıp=, operatıon=, and Result.INVOKED becomes result=ınvoked (reproduced against 3.9.6 through ZKAuditProvider.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) and QuorumPeer.getDetailedPeerState() (zk_peer_state in mntr / /commands/monitor): electıon, dıscovery, synchronızatıon, followıng, observıng.
  • QuorumPeer.QuorumServer.getType: the peerType config switch, same fold.

This uses Locale.ROOT at those sites, matching ZKHostnameVerifier (PrepRequestProcessor pins Locale.ENGLISH for the same reason). AuditEventTest#testFormatRegardlessOfDefaultLocale sets a tr-TR default locale (restored in finally) and asserts the documented key names; it fails before the change and passes after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant