Adding embedded property with depth >20 causes OrientDB to become unresponsive
Opened this issue · 0 comments
OrientDB Version: 3.2.32
Java Version: openjdk 11.0.16 2022-07-19
OS: Ubuntu 24.04.1 LTS
Expected behavior
Updating a vertex to add an embedded property or insert a vertex with an embedded property at a depth higher than OrientDB can handle should return an error or be handled gracefully.
Ability to set a max depth of embedded properties.
Actual behavior
OrientDB does not release the connection and causes high CPU usage. Enough subsequent inserts eventually cause the database to become unresponsive.
Steps to reproduce
On any database run the following:
INSERT INTO V SET brokenembedded = {"@type":"d","1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"10":{"11":{"12":{"13":{"14":{"15":{"16":{"17":{"18":{"19":{"20":{"21":{"22":{"23":{"24":{"25":{}}}}}}}}}}}}}}}}}}}}}}}}}}
or
UPDATE #10:0 SET brokenembedded = {"@type":"d","1":{"2":{"3":{"4":{"5":{"6":{"7":{"8":{"9":{"10":{"11":{"12":{"13":{"14":{"15":{"16":{"17":{"18":{"19":{"20":{"21":{"22":{"23":{"24":{"25":{}}}}}}}}}}}}}}}}}}}}}}}}}}
This will result in high database usage and the database does not release.
EDIT: It appears that the operation does eventually complete after a long time with the commands above (>10 minutes) and the time increases exponentially per level of depth. When inserting larger objects than above (with a depth of 20) on larger databases, the commands do not seem to finish and do not give any feedback.