|
[Informix MACH11] Application design consideration in MACH11 cluster environment -- Posted by inturi on Wednesday, June 18 2008 Application design considerations to work with MACH11 cluster:
Ø -7350 : Optimistic concurrency failure -7350 Attempt to update a stale version of a row An attempt was made to update a stale copy of a row. This caused an optimistic concurrency failure. This error can occur when using updatable secondary and the current version of the row has not yet been replicated to the secondary on which the client application is connected. This error code is also returned when table schema at secondary server doesn't match with the table schema at primary server. Ø -7351 : Network connection lost between primary and secondary server -7351 Connection between secondary and primary has been lost The connection between the secondary and the primary has been lost. This will prevent the updates on secondary until connectivity has been reestablished. -7350 error should be treated same as lock timeout error (ISAM error -154) and DML statement can be retried if statement fails with this SQL error. -7351 : When application receives this error, better to rollback the txn and restart the txn. Probably better to disconnect and reconnect SQL connection as well. Optimistic concurrencyWhile updating/deleting a row at secondary server, secondary server assumes that update/delete operation is sane and replicates the update/delete operation to be executed at primary server. Primary server compares before image of this replicated operation with the local row. If row images doesn’t match then primary server rejects the update/delete operation and returns collision error – 7350 to secondary server. Secondary server returns this error to the client application. Client application upon receiving collision error -7350, it can retry the update/delete statement again. Version columns:Two new optional hidden shadow integer columns are introduced from IDS V11.50 onwards. These are checksum(ifx_insert_checksum) and row version (ifx_row_version) shadow columns. Checksum shadow column (ifx_insert_checksum): When a row is inserted first time, its in-row data checksum is calculated and its value is populated into ifx_insert_checksum column. After this, ifx_insert_checksum column is never updated for the life of this row. Row version column (ifx_row_version): Every time when a row is updated, ifx_row_version column value is incremented by one. MACH11 uses these two shadow columns to find optimistic concurrency failures. If version shadow columns exist then MACH11 updatable secondary node only sends these two version shadow columns for the before image of the update/delete operation to the primary server. Primary server then compares these two columns with the local row version shadow columns to find optimistic concurrency failures. This greatly reduces network bandwidth usage and improves performance. In-place alter method is used to add version shadow columns to an existing table. Syntax to add version shadow columns while creating a new table: Create table tab(c1 int, c2 char(10)) with vercols; Syntax to add version columns with alter statement: Alter table tab add vercols; |
|
| [Edit] | Home |
| If this information is helpful to you then please click here and post one simple tip that you know. Share your knowledge! |