Details
-
Bug
-
Resolution: User Error
-
Major
-
None
-
None
-
None
-
None
-
Encountered with
java-client 2.4.8
Server 4.6.1
Description
Attached is a simple unit test.
A document content represents an incremented counter.
In tests, the document content (Long) is incremented 10 times from 0 to 10.
With even increments, the document representation is LegacyDocument. The content is cast to long, incremented, and the document is *replace*d
With odd increments, the document representation is LegacyDocument. The content is cast to long, incremented, and the document is upsert*ed as *JsonLongDocument
This replacement simplifies a business scenario and in reality should happened only once (to be followed with successive calls to bucket.counter
Something goes wrong during the 9 increment, the content is correctly read (8) and incremented (9).
However, during the 10 increment - bucket.upsert(JsonLongDocument) - the value is reset before increment (testInc method simulate that).
Also, the value returned by bucket.get is not as expected and differ from the value returned (testGet method simulate that).