Hi Everybody,
I am testing a two case scenarios to get myself confident at sql replication topology especially with retention periods used by Distribution Agent clean up job. From MSDN forums and books online, I came to know that the parameter "immediate_sync" plays key role in this clean up process. And to better optimize the SQL replication in terms of size and volume, we should take a close look at this job. So moving on, here are my results.
Note: The tables I'm referring below are MSrepl_commands and Msrepl_Transactions
Test 1 with below settings:
Immediate Sync = 0 (False)
Min_distretention = 1
Max_distretention = 24
Observations:
1) Created a Publication and Subscription with independent agent
2) Inserted some values in the article
3) Checking Clean up Job every 10 min - ALL replicated Commands/ Transactions are being deleted EVEN the min_distretention is 1 Hour. This is a expected behavior because I set immediate_sync to FALSE.
4) Later added NEW subscription and synced
5) Manually DISABLED dist agent for this subscription ( TESTING PURPOSE )
6) Clean up JOB - NO commands/transactions are deleted UNTIL they have reached max_distretention 24 hr.
7) REINT second SUB and synced
8) -- THIS IS THE PART I'M CONFUSED -- : In Subsequent runs Clean up Job is not deleting the rows that were replicated to Subscriber. Instead It is deleting the commands which are older than min_retention 1 hr. IS IT NORMAL BEHAVIOR ?
I thought if parameter IMMEDIATE_SYNC set to FALSE, transactions will be purged at every Clean up run. Am I missing anything?
Thanks in advance.
Harsha