Você está na página 1de 4

March 25, 2010 04:18:22 PM Total Pages : 4

SECTION 1 – REPLICATION SERVER ARCHITECTURE


6/10%

ID Server : Assigns globally unique Ids to replication objects and connections. Is a RS that
registers all the RS and databases in a repliction system. Typically the first RS to be installed.
ID Server must be running when route created, or a database connection is created.

Replication System Domain :

INBQ=Inbound Queue
OUTBQ=Outbound Queue

1. RA read pdb log and generates LTL output


2. RA thread writes LTL into the INBQ
3. The DIST thread associated with the pdb waits for the SQT thread to read from the
INBQ by calling SQM and puts txn in commit order.
4. Once a complete txn is seen, the DIST call the SRE to determine which command
should be sent to which site.The SRE appends the destination db id ( DBID ) to each
row of the txn.
5. DIST then calls the TD to place begin txn in each OUTBQ. TD also appends 2 byte
counter ( OQID ) to ensure uniqueness.
6. The MD optimizes delivery by grouping msgs bound for multiple sites that are
controlled by same route. DSI gets a call back from SQT when the txn committed.
7. DSI scheduler attempts to group txns and then dispatches them to available EXEC
thread.
8. EXEC performs function string mapping and error handling.
9. If msgs destined for another site, RSI sender will deliver messages to RRS.
10. RSI user at RRS calls MD to resolve delivery instructions by reading RSI_MESSAGE
header.
11. The RSI truncation point is passed to the sending RS when a route secondary
truncation point msg is received.

Inbound Queue : Scanned txn log records for objects marked for replication are stored in the
INBQ of the stable device until txn are committed.

Outbound Queue : Subscribed txn in the INBQ are moved to the appropriate outbound queue
in commit order.

Connection : RS communicates with databases using connections.

Route : Two RSs communicate using routes.

Replication Server Threads


RepAgent (RA) :
1. Scans pdb txn log for tables and stored procedures marked with sp_setreptable and
are sent to the PRS INBQ.
2. RS maintains a secondary truncation point within the pdb. The 2ndary trunc point is a
pointer to the oldest active txn that has not been completely read by RA.
3. The RSSD rs_locater table is used by RA to maintain a scan point between the 2ndary
trunc point and the last page of the txn log.

Stable Queue Manager (SQM) :


1. One SQM per for each queue.
2. Uses “store and forward” technique to increase availability and recovery.
3. Sqm detects duplicate messages.
4. Physical i/o is performed by dAIO.
5. Message not automatically deleted, only when requested to do so.
6. Messages can be reread from the undeleted messages in the queue.
7. Duplicate messages from the origin queue ID are recognized and ignored.
8. SQM supports multiple writers and one reader of the stable queue.

Stable Queue Transaction (SQT) :


1. Reads msgs from the inbound queue and sorts them in commit order.
2. Also manages the outbound queue.
3. The DIST thread is notified by SQT when the commit record is scanned.
4. DIST, DSI and Standby DSI are SQT clients.

Executor (EXEC) :
1. Each pdb has one EXEC thread for the RA user to handle incoming connections.
2. Two types :- RA-USER & RSI USER.

Distributor (DIST) :
1. Each pdb/INBQ has one DIST thread.
2. Calls SQT and SQM to read INBQ in commit order.
3. It makes calls to SRE, TD and MD to determine destination of txn.
4. Destination could be the corresponding OUTBQ and/or RSI (route) OUTBQ
corresponding to downstream RS.

Subscription Resolution Engine (SRE) :


1. Determines which txn have subsriptions and their destination database ID.
Transaction Delivery Module (TD) :
1. Is called by DIST to deliver txn rows to data servers and other Rss.
2. Calls MD to deliver txn to OUTBQ.

Message Delivery Module (MD) :


1. Id called by TD inside of DIST to optimize routing of txns to data servers.

Data Server Interface (DSI) :


1. Reads txns from OUTBQs using SQT and SQM and executes these txns on ASE/non-
ASE data servers.
2. Consists of a DSI-S and n DSI EXEC threads.

Replication Server Interface (RSI) :

Replication Server Daemons


Alarm (dAlarm) : tracks async I/O and callback in-/completions
Async I/O (dAIO) : handles physical I/O
Connection Manager (dCM) : coordinates incoming connections.
SySAM (dSYSAM) : license daemon
Subscription Retry (dSUB) : retries subsctiptions
Recovery (dREC) : recovery process.

Summary :
• RA of pdb forwards txn to INBQ of pRS
• INBQ of pRS filters txns and passes them to the rRS (via route) or rdb' OUTBQ.
• OUTBQ of the rRS sends batches over a route to the rdb OUTBQ.
• Txns in the rdbOUTBQare scheduled.
• Txns are applied to the rdb by maint user.

Você também pode gostar