← Back to team overview

drizzle-discuss team mailing list archive

Re: Improving the Engine API (was Re: New PBXT Drizzle-specific storage engine...)

 

Ann W. Harrison wrote:
Paul,


StorageEngine::commit(session, bool all)
StorageEngine::rollback(session, bool all)

I suggest we change this to the following:

StorageEngine::beginTransaction(session)
StorageEngine::commitTransaction(session)
StorageEngine::rollbackTransaction(session)
StorageEngine::startStatement(session)
StorageEngine::endStatement(session, abort = true/false)


You'll also want

StorageEngine::prepareTransaction(session)
StorageEngine::recover(session, XID *xids, unit length)
StorageEngine::commit_by_xid(session, XID* xid)
StorageEngine::rollback_by_xid(session, XID* xid)

Yes, these calls already exist.

where an XID is a transaction identifier of a type to be
defined.  Or reused.

Yep.

Though, as I've mentioned in an earlier email, one problem I currently have is which "authority" to trust in the generation of a globally unique XID...

I have a number of choices:

1) Have each server instance supply unique XIDs as simply its server ID and an atomic sequence unique to the instance

2) Have a separate process/node be the authority of handing out batches of XIDs that a requesting server can use with a guanrantee of uniqueness from the responding authority node (basically, a DTC (distributed transaction coordinator) in SQL Server terms...)

3) Use UUIDs

4) Use a combination of server/instance ID and some hi-res timestamp of sorts

5) Some other idea folks come up with :)

Hopefully, I can solve this problem this and next week and make the generation of XIDs modular so that different solutions can be used...

Cheers,

Jay



References