92c4c2a Ticket 49619 - adjustment of csn_generator can fail so next generated csn can be equal to the most recent one received

Authored and Committed by tbordaz 6 years ago
    Ticket 49619 - adjustment of csn_generator can fail so next generated csn can be equal to the most recent one received
    
    Bug Description:
    	On consumer side csn_generator ajustment occurs (let CSN = highest known csn)
    
    	    when a replication session starts
    	    when a csn is generated locally and than csn is <= CSN
    
    	During adjustment, in the case
    
    	    there is no remote/local offset (time change)
    	    the current_time on the consumer is identical to CSN
    
    	Then next locally generated csn will only differ with seqnum
    
    	The seqnum of the csn_generator is increased only if CSN.seqnum is larger
    	than the csn_generator one.
    	In case of egality, it remains unchanged.
    
    	The consequence is that the next locally generated csn will be identical to CSN (except for the RID).
    	So even after csn_generator adjustment, csn_generator may create csn that are not larger than the CSN
    
    Fix Description:
    	compare the new generated timestamp (time+offsets) with adjustment one.
    	If the new is greater or EQUAL, make sure the local seqnum is ahead the remote one
    
    https://pagure.io/389-ds-base/issue/49619
    
    Reviewed by: Mark Reynolds
    
    Platforms tested: F27
    
    Flag Day: no
    
    Doc impact: no
    
        
file modified
+1 -1