Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312879 - FailOverParticipant: Type change from MASTER to BACKUP does not work
Summary: FailOverParticipant: Type change from MASTER to BACKUP does not work
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Fluegge CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard: offline-04
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-14 05:01 EDT by Erwin Betschart CLA
Modified: 2010-06-29 09:20 EDT (History)
0 users

See Also:


Attachments
Test v1 (7.57 KB, patch)
2010-06-13 03:54 EDT, Martin Fluegge CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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/