orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

Make schema changes transactional in plocal

Open andrii0lomakin opened this issue 13 years ago • 5 comments

In plocal storage it is relatively simple to make schema changes transnational. Document changes are transnational now, so we need only to add log messages related to file/cluster creation which will be rolled back or committed during transaction rollback/commit accordingly.

This change allow completely align blueprints and OrientDB models.

andrii0lomakin avatar Aug 30 '13 06:08 andrii0lomakin

In theory we could store the sql command as payload. I was thinking to other stuff like "alter database dateformat yyyy-MM-dd". If we had such log we could totally remove the server's log used in replication!

lvca avatar Aug 30 '13 10:08 lvca

SQL commands, does not work on data store level. For example if server fails in the middle of SQL command execution, it can not be restored from failed state using such approach. In order to support durability feature all operations should be logged on disk operations level (or more precisely on disk cache level). Also all SQL commands are translated in record changes, so such commands like ""alter database dateformat " which causes code:

case DATETIMEFORMAT:
  storage.getConfiguration().dateTimeFormat = stringValue;
  storage.getConfiguration().update();
  break;

public void update() throws OSerializationException { final byte[] record = toStream(); storage .updateRecord(CONFIG_RID, record, OVersionFactory.instance().createUntrackedVersion(), ORecordBytes.RECORD_TYPE, 0, null); }

are already durable and transactional in plocal storage.

The only problem is cluster creation, truncation and deletion. If we add log events for this type of actions they will be durable too. But all "alter database" commands are transactional now, that is why I thought about moving auto sharding solution from storage level to cluster level (in https://github.com/orientechnologies/orientdb/issues/1600 issue).

andrii0lomakin avatar Aug 30 '13 13:08 andrii0lomakin

:+1:

lvca avatar Aug 30 '13 13:08 lvca

))

andrii0lomakin avatar Aug 30 '13 13:08 andrii0lomakin

Hi guys, any news about this proposal?

Thanks

giastfader avatar Dec 01 '13 17:12 giastfader