Details
-
Story
-
Status: Closed (View Workflow)
-
TBD
-
Resolution: Done
-
None
-
None
-
-
CP: sprint 138
-
1
-
Core: Platform
-
TBD
Description
PostgreSQL allows up to 1000 digits for the _version number: https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL
JSON has no number restriction: https://www.json.org/json-en.html
RAML also has no restrictions for the number and integer types: https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md/#number
mod-inventory-storage declares _version to be of RAML type integer: https://github.com/folio-org/mod-inventory-storage/blob/v23.0.2/ramls/instance.json#L11
RMB incorrectly generates Java type Integer in org.folio.rest.jaxrs.model.Instance.java.
This will result in a parse exception when Integer.MAX_VALUE = 2147483647 is exceeded.
It takes 68 years when incrementing each second. It takes only 1 year when incrementing 68 times per second.
There might be stress tests, load tests, performance tests or other tests that update the same instance, holding or item frequently and therefore it might be possible that an overflow occurs.
Changing the optimistic locking trigger to wrap around from 2147483647 to 0 is the easiest fix:
(oldvalue::numeric + 1) % 2147483648
TestRail: Results
Attachments
Issue Links
- relates to
-
MODINV-684 Instance null pointer exception due to missing _version causes import problems in Kiwi and Lotus (Morning Glory)
-
- Closed
-
-
MODINV-693 Instance null pointer exception due to missing _version causes import problems in Kiwi and Lotus (LOTUS HF1)
-
- Closed
-
-
MODINV-694 Instance null pointer exception due to missing _version causes import problems in Kiwi and Lotus (KIWI HF3)
-
- Closed
-
-
MODINV-702 Check that Instance null pointer exception due to missing _version is resolved in Morning Glory
-
- Closed
-