I’m seeing the following warnings in the server log periodically (couldn’t summarize it in the title - “Title seems unclear, is it a complete sentence?” pops up no matter what):
It means the ADD op failed, and the most likely cause is what you showed: using CREATE_ONLY when an entry with that key already exist. You can confirm by checking the error code returned. If it is a CREATE_ONLY policy violation, it should have returned FAIL_ELEMENT_EXISTS (24).
The database core always issue a warning when an op fail. There are also implied consequences. If your failed op is part of a list of ops submitted in a single transaction, any op failing will cause the whole transaction to fail and be rolled back. If you always submit transactions with a single op, you can probably ignore that particular warning.
Going forward, we have thought of a NOFAIL usage model (i.e. CREATE_ONLY_NOFAIL), where policy violations would quietly no-op rather than fail, but it has not been implemented yet. We’ll probably get to it when there is enough customer demand, or time permitted.
Yep, I do check for FAIL_ELEMENT_EXISTS indeed and use a single op here for emulation of adding an item to a set structure (similar to redis).
NOFAIL mode would be a nice solution. Though I don’t see why the existing CREATE_ONLY policy should trigger a warning for an expected failure, because such failure is a part of policy semantics and is… expected, not requiring attention. Mixing such warnings with real warnings only complicates log reading.