Open mikhalov opened 1 month ago
Hi,
I think this is due some data migrations happening while the property is created, you can skip the check and migration of the property using the unsafe
option, if you are not sure the property has the right values you can run a migration of data before, this is actually what OrientDB does for itself.
here an example of create property unsafe:
crate property MyVertex.name String unsafe
Correspondent code that do the data migration, take from OrientDB code:
try (OResultSet result =
database.query("select from MyVertex where name.type() <> 'STRING' ")) {
while (result.hasNext()) {
ODocument record = (ODocument) result.next().getElement().get();
record.field("name", record.field("name"), OType.STRING);
database.save(record);
}
}
Obviously you can edit as you need.
We will check on our side as well, this data migrations need to be done only by one node, and I think as today are re-executed on all the nodes in parallel, creating potential issues.
@tglman
Currently, we are using the Tinkerpop API to create properties: com.tinkerpop.blueprints.impls.orient.OrientElementType#createProperty(java.lang.String, com.orientechnologies.orient.core.metadata.schema.OType)
When we do this via ODatabaseSession.query(), we get the following error:
Caused by: com.orientechnologies.orient.core.exception.OSchemaException: Cannot create property 'property' inside a transaction
Hi,
DDL as today cannot run when another transactions is active, you can make sure that no transaction is active with commit
or rollback
methods, for the blueprints APIs are still supported in 3.2.x but are deprecated and will be removed in the next major, so for long term support I would suggest to use the gremlin (orientdb-gremlin dependency and tp3 distribution) or the native OrientDB APIs.
Bye
Due to this issue, we cannot launch the production server successfully. The migration stalls and the application fails to initialize correctly in the distributed environment.
We are encountering a problem when starting the application in a distributed database configuration with 5 nodes. The issue occurs specifically when creating a property for a vertex with a large number of records in the database. During this operation, we see the following error:
We tried changing the database configuration, but it didn't help. Here's the configuration we used:
Additionally, in the logs of the master node, we see the following warning: