Split replication threads
- Last Updated: August 8, 2023
- 4 minute read
- OpenEdge Pro2
- Version 6.5
- Documentation
You can split each replication thread into multiple split threads
regardless of whether it serves replication of a single table or group of tables. You
can split a single thread into a maximum of ten split threads. When you split a thread
into n number of parts, it provides n-1 split
threads. For example, if you split the thread 5 (replBatch5.bat) into four parts, it provides three split threads 51, 52,
and 53 along with the original thread 5. This means, the four parts are threads 5, 51,
52, and 53.
Pro2 determines the number of a split thread dynamically based on the
RECID of the source record, and groups together all
the split threads that belong to the same record or RECID. This allows you to run multiple processes without adding queue
compression and prevents out-of-sequence processing of more changes to the same ROWID or RECID.
- Generate new trigger code for splitting threads
- Run split threads
- Assign a table to the split thread
Generate new trigger code for splitting threads
- tplt_repltrig_split_without_compression.p—Splits threads but does not apply queue compression.
- tplt_repltrig_split_with_compression.p—Splits threads and supports queue compression.
To generate new trigger code:
- In the Pro2 web interface, navigate to the Properties tab.
- Search for
DEL_TRIG_TEMPLATEand click Edit.The Edit Property window appears.
- Specify the Value as
tplt_repltrig_split_with_compression.portplt_repltrig_split_without_compression.p.and click Save. - Search for
WRI_TRIG_TEMPLATEand click Edit.The Edit Property window appears.
- Specify the Value as
tplt_repltrig_split_with_compression.portplt_repltrig_split_without_compression.p.and click Save. - In the Pro2 web interface, click the Properties tab and modify the property values of the templates
DEL_TRIG_TEMPLATEandWRI_TRIG_TEMPLATEto point to one of the split trigger templates. - Click Manage Replication , and select the
database instance.
The Edit Replication window appears.
- Click Next.
- Navigate to the Generate Code tab, and
select the Replication Triggers checkbox to regenerate
the trigger code.Note: Check if the
jobrunner.batfile is running. If not, navigate to \bprepl\Scripts from Windows Explorer , and double click thejobrunner.batfile. The Proenv window appears. - Check if new code is generated by navigating to the \bprepl\repl_d folder. The date and time of the files in that folder are recent if they were updated successfully.
- Copy the repl_d and repl_w folders from \bprepl, and paste them in \db\bprepl folder.
Run the split replication threads function
- Create three new
.batfiles:- Create three copies of the
replBatch5.batfile located in the Pro2\bprepl\Scripts folder and rename them asreplBatch51.bat,replBatch52.bat, andreplBatch53.batrespectively. - Edit the
replBatch51.batfile, locate and modify Thread=5 to Thread=51, and save your changes. Repeat this step forreplBatch52.batandreplBatch53.batfiles.
- Create three copies of the
- Create new thread positions:
- Go to the Pro2 web interface and click Manage Replication, and select the
database instance.
The Edit Replication window appears.
- Click the Advanced Configuration tab.
- For thread 51, type
51in the field next to the Create New Thread button, and then click Create New Thread. Repeat this step for threads 52 and 53.
- Go to the Pro2 web interface and click Manage Replication, and select the
database instance.
- Create a new property:
- In the Pro2 interface, click the Properties tab, and then click Add.
- In the Property Name field,
specify the name of the property as
SPLIT_THREAD5. - In the Value field, specify the number of threads as 4.
You can add up to n-1 value where n is the number of thread. The maximum value allowed per thread is 10. However, if you specify a value (characters or negative numbers) other than the numbers 1 to 10, then the trigger uses the thread number.
After generating the trigger code and creating new property for split threads, if you
do not create the .bat files and do not schedule
the task entries, then the data remains in the queue until the new thread jobs are
started.
Progress recommends that you do not change the split number if there are existing records in the queue. Changing the split number might push the changes of the same record and row to a differently calculated queue.
Assign a table to the split thread
After the replication thread is split, you assign a table to the thread.
- In the Pro2 web interface, click Manage
Replication, and select the database instance.
The Edit Replication window appears.
- Select Advanced Configuration and
assign a table (for example,
Customertable) to Thread 5 from the Thread# column. - Update the tables on the threads with some test information. This causes the threads to split because the updated tables for a replication.
- Check that the threads have split in the Pro2 web interface by clicking the Total Threads watch-box. The threads are distributed among the split threads.
- To execute the replication records, run the
replbatch5.bat, replbatch51.bat, replbatch52.batandreplbatch53.batfiles.After the replication is complete, the status of replication threads appear as running in the Replication section of the Pro2 web Dashboard.