Jialin Chen created ZOOKEEPER-5107:
--------------------------------------

             Summary: Audit log omits the create mode of sequential and TTL 
nodes created in a multi
                 Key: ZOOKEEPER-5107
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-5107
             Project: ZooKeeper
          Issue Type: Bug
          Components: audit
    Affects Versions: 3.10.0, 3.8.7, 3.9.6
            Reporter: Jialin Chen
            Assignee: Mohammad Arshad


For the creates inside a {{multi}}, {{AuditHelper}} looks up the create mode in 
a map keyed by the requested path. The lookup misses for sequential nodes, 
because the result carries the actual path ({{/node-0000000005}}) rather than 
the requested one ({{/node-}}), and for TTL nodes, because {{createTTL}} ops 
are never put into the map. Those audit entries are written without 
{{znode_type}}.

Steps to reproduce (standalone server built from master at 48f7cb00e, started 
with {{-Dzookeeper.audit.enable=true -Dzookeeper.extendedTypesEnabled=true}}): 
one {{multi}} creating {{/m-plain}} (PERSISTENT), {{/m-seq-}} 
(PERSISTENT_SEQUENTIAL), {{/m-ttl}} (PERSISTENT_WITH_TTL) and {{/m-eph}} 
(EPHEMERAL).

Actual audit entries:
{noformat}
operation=create        znode=/m-plain  znode_type=persistent   result=success
operation=create        znode=/m-seq-0000000005 result=success
operation=create        znode=/m-ttl    result=success
operation=create        znode=/m-eph    znode_type=ephemeral    result=success
{noformat}

Expected: {{znode_type=persistent_sequential}} and 
{{znode_type=persistent_with_ttl}} on the second and third entries, as for the 
same creates outside a {{multi}} (the TTL case since ZOOKEEPER-4725).

The path lookup dates back to the introduction of the audit log in 
ZOOKEEPER-1260 (3.6.0).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to