Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312879

Summary: FailOverParticipant: Type change from MASTER to BACKUP does not work
Product: [Modeling] EMF Reporter: Erwin Betschart <erwin>
Component: cdo.coreAssignee: Martin Fluegge <martin.fluegge>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: offline-04
Attachments:
Description Flags
Test v1 none

Description Erwin Betschart CLA 2010-05-14 05:01:10 EDT
Build Identifier: 3.0

Changing the type from MASTER to BACKUP of a FailOverParticipant is not yet fully implemented.

Reproducible: Always
Comment 1 Eike Stepper CLA 2010-06-13 01:11:16 EDT
The problem is that while a FailoverParticipant is in state MASTER the following two replication "counters" are not maintained (increased):

- SynchronizableRepository.lastReplicatedBranchID
- SynchronizableRepository.lastReplicatedCommitTime

When the MASTER is then switched to BACKUP the initial syncing phase of the new BACKUP asks for data from the new MASTER that is already in the new BACKUP. Writing this duplicate data leads to exceptions.
Comment 2 Eike Stepper CLA 2010-06-13 01:13:50 EDT
Fix in FailoverParticipant.changingType(Type, Type):

      if (newType == MASTER)
      {
        // Switch off synchronizer
        doStopSynchronization();
      }
      else
      {
        // Bug 312879
        setLastReplicatedBranchID(getStore().getLastBranchID());
        setLastReplicatedCommitTime(getLastCommitTimeStamp());

        // Switch on synchronizer
        doStartSynchronization();
      }
Comment 3 Eike Stepper CLA 2010-06-13 01:14:13 EDT
Committed to HEAD
Comment 4 Martin Fluegge CLA 2010-06-13 03:54:27 EDT
Created attachment 171796 [details]
Test v1

I additionally attached a patch that verfies the fix.

Committed to HEAD.
Comment 5 Eike Stepper CLA 2010-06-29 04:36:10 EDT
Available in 3.0 GA:
http://download.eclipse.org/modeling/emf/cdo/updates/3.0-releases/