Dec 28, 2011

GTM fourth improvement

Now I'm tackling the fourth GTM improvement, to correct backup algorithm.

Current implementation just proxies begin transaction/get GXID type command directly to the backup.   Backup tries to assign GXID and transaction handle independently and depending upon the order of each thread execution, each transaction can be assigned different gxid at GTM standby, which may cause serious problem when standby fails over.

The improvement corrents this.   Now both handle and gxid are backed up.   GTM standby will assign transaction struct slot based upon backed-up handle and use backed-up gxid to keep everything consistent.

One thought about sequence.   Because it is not practical to backup current sequence value, sequence command is essentially proxied to the backup (standby).   Because history of sequence value has very little meaning and requirement is to begin the next value correctly when failed over, I think current mechanism should work well.

More over, I eliminated needless response from Standby to ACT.    When synchronous backup is specified, acknowledgement will be exchanged to make sure that backups reached the standby.

Most of this is skipped when message comes through GTM-Proxy.  I need to find where I should insert the code to synchronize in this case.

----
(Addenda: 30th Dec., 2011)

1. Add "Backup_synchronously" to GTM_conn or GTM_TheadInfo

2. Check Backup_synchronously when flush to the client and "send_smething".   Send something to backup before send something to the client.

3. Check if I'm running in standby or not when accepting commands.  

No comments:

Post a Comment