Repository navigation
Conversation
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.
For the creates inside a
multi,AuditHelperlooked up the create mode in a map keyed by the requested path. The lookup missed in two cases, so those audit entries were written withoutznode_type:/node-0000000005) rather than the requested one (/node-);createTTLops were never put into the map.The same creates outside a
multiare logged withznode_type=persistent_sequentialandznode_type=persistent_with_ttl(the latter since ZOOKEEPER-4725). The path lookup dates back to the introduction of the audit log in ZOOKEEPER-1260.A
multiyields exactly one result per op, in order (PrepRequestProcessorbuilds one txn per op andDataTreeappends one result per txn), so the create mode is now taken from the op at the same position. That covers both cases, and the path map is removed.Testing
Slf4JAuditLoggerTest#testMultiOperationCreateModeAuditLogscreates a sequential node and a TTL node in onemultiand checks that both entries carryznode_type; it fails without the fix and passes with it.Slf4JAuditLoggerTest,AuditEventTest,StandaloneServerAuditTest,MultiOperationTestandMultiAsyncTransactionTestpass; checkstyle and spotbugs report no issues.zookeeper.audit.enable=true: amulticreating a persistent, a sequential, a TTL and an ephemeral node now logsznode_typefor all four entries; before the fix the sequential and TTL entries had none.