User transactions, Distributed tables and indexes, User transactions 4-6 – HP NonStop G-Series User Manual

Page 46: Distributed tables and indexes 4-6

Advertising
background image

SDR Operations

HP NonStop SQL DDL Replicator User’s Guide 545799-005

4-6

Special cases

Without SDR, the operator has to create a collation manually to allow RDF to continue
processing.

With SDR, the operator no longer needs to intervene. SDR detects the absence of the
audited file and inserts a CREATE COLLATION into the depot file, before the collation
compiler has a chance to generate its audited updates. Thus, CREATE COLLATION is
replicated before RDF encounters the compiler generated audited updates.

User Transactions

Normally, SQL creates and commits a transaction for each DDL operation. No user
transaction management is required. But, you can execute DDL in a transaction that
you create and commit. This leaves SDR with a dilemma, as it does not know the final
status of the user transaction when it is time to replicate the DDL.

See paragraph

Handling DDL Operations performed under a User Transactions

on

page 3-4 for a discussion on the options available to deal with this situation.

Distributed Tables and Indexes

If a table or index is distributed, with partitions or indexes on multiple systems, RDF
updaters on all systems must be stopped at the same point in processing their primary
system audit. SDR writes SRU audit to the audit trail of every referenced system.

Since SDR might be processing another distributed DDL operation at the same time,
this leads to the possibility of confusion and deadlock. Two sequences of SRU audit
records sent to remote audit trails might be inserted in different orders. One RDF might
be waiting for one distributed DDL replication while another RDF is waiting for a
different DDL replication.

To avoid this problem, SDR obtains an SDR lock on each of the affected systems
before writing any of the SRU audit. The SDR monitor on each system manages the
lock. If SDR cannot immediately obtain all the locks it needs, it releases all the locks,
waits for a short time, and tries again. A random backoff algorithm ensures resolution
within a short time.

If the SDR monitor on any of the affected systems is not accessible, the DDL operation
will be terminated with an error message.

Caution. The downside of this strategy is that the CREATE COLLATION operation could fail
on the primary system, for example due to syntax error in the compiler input, but succeed on
the backup system. This can be avoided by making sure that both systems have the same
input edit file.

Note. If you have a serious need to execute DDL in a user transaction, please contact HP
product support.

Advertising
This manual is related to the following products: