apache / apache/accumulo

ZooReaderWriter.mutateExisting returns null if the Mutator did not change the entry

Open
#5,063 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
487
Avg merge
4d 5h
Merged PRs (30d)
13

Description

If the Mutator returns null, indicating that the mutator did not change anything, that null result skips setting anything on the ZK node. There are a few problems with this:

1. The behavior of returning null is not well defined in the Mutator class (null means don't set anything? empty byte array means clobber the existing?)
2. mutateExisting behavior is not well defined (should it return the current data if it is unchanged?)
3. mutateExisting implementation returns the mutate result, whether or not the data was unchanged

Contributor guide

Open the contributing guide

Research direction

No file or test path is named. Start at ZooReaderWriter.mutateExisting and the Mutator contract, tracing how a null result is handled for the ZooKeeper node. Done means the null semantics and mutateExisting return behavior are explicitly defined and covered for unchanged and changed entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.