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.

The following topics are covered in split replication threads:
  • Generate new trigger code for splitting threads
  • Run split threads
  • Assign a table to the split thread

Generate new trigger code for splitting threads

You can generate and install a new replication trigger code to implement thread splitting, or replace the old triggers for tables or threads that you want to split. It is recommended to replace all the existing trigger code with the newly generated trigger code using a split trigger template.
Note: New trigger code only needed if using replication threads, not need if using CDC.
The following split trigger templates are available in the replication template folder Pro2\bprepl\repl_tmpl:
  • 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:

  1. In the Pro2 web interface, navigate to the Properties tab.
  2. Search for DEL_TRIG_TEMPLATE and click Edit.

    The Edit Property window appears.

  3. Specify the Value as tplt_repltrig_split_with_compression.p or tplt_repltrig_split_without_compression.p. and click Save.
  4. Search for WRI_TRIG_TEMPLATE and click Edit.

    The Edit Property window appears.

  5. Specify the Value as tplt_repltrig_split_with_compression.p or tplt_repltrig_split_without_compression.p. and click Save.
  6. In the Pro2 web interface, click the Properties tab and modify the property values of the templates DEL_TRIG_TEMPLATE and WRI_TRIG_TEMPLATE to point to one of the split trigger templates.
  7. Click Manage Replication , and select the database instance.

    The Edit Replication window appears.

  8. Click Next.
  9. Navigate to the Generate Code tab, and select the Replication Triggers checkbox to regenerate the trigger code.
    Note: Check if the jobrunner.bat file is running. If not, navigate to \bprepl\Scripts from Windows Explorer , and double click the jobrunner.bat file. The Proenv window appears.
  10. 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.
  11. Copy the repl_d and repl_w folders from \bprepl, and paste them in \db\bprepl folder.

Run the split replication threads function

To run the split replication threads function, consider the example of splitting Thread 5 into four parts and perform the following steps:
Note: You can only run split threads after generating new trigger code.
  1. Create three new .bat files:
    1. Create three copies of the replBatch5.bat file located in the Pro2\bprepl\Scripts folder and rename them as replBatch51.bat, replBatch52.bat, and replBatch53.bat respectively.
    2. Edit the replBatch51.bat file, locate and modify Thread=5 to Thread=51, and save your changes. Repeat this step for replBatch52.bat and replBatch53.bat files.
  2. Create new thread positions:
    1. Go to the Pro2 web interface and click Manage Replication, and select the database instance.

      The Edit Replication window appears.

    2. Click the Advanced Configuration tab.
    3. For thread 51, type 51 in the field next to the Create New Thread button, and then click Create New Thread. Repeat this step for threads 52 and 53.
  3. Create a new property:
    1. In the Pro2 interface, click the Properties tab, and then click Add.
    2. In the Property Name field, specify the name of the property as SPLIT_THREAD5.
    3. 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.

To assign a table to the thread:
  1. In the Pro2 web interface, click Manage Replication, and select the database instance.

    The Edit Replication window appears.

  2. Select Advanced Configuration and assign a table (for example, Customer table) to Thread 5 from the Thread# column.
  3. Update the tables on the threads with some test information. This causes the threads to split because the updated tables for a replication.
  4. 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.
  5. To execute the replication records, run the replbatch5.bat, replbatch51.bat, replbatch52.bat and replbatch53.bat files.

    After the replication is complete, the status of replication threads appear as running in the Replication section of the Pro2 web Dashboard.