Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After introduction of detached state components lifecycle was change in a way that now it's possible to start new set of components while you still have old one active. For case of update puller it mean that for some time we will have 2 update pullers active and they will try to apply transactions concurrently. That is incorrect and causing errors during transactions apply phase. This commit introduce new phase in component switch lifecycle, just after old component shutdown. And we will use this phase to start new update puller @pair-with @lutovich
- Loading branch information
1 parent
84a4f36
commit b36c99a
Showing
8 changed files
with
128 additions
and
81 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
enterprise/ha/src/main/java/org/neo4j/kernel/ha/MasterUpdatePuller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,64 @@ | |||
/* | |||
* Copyright (c) 2002-2016 "Neo Technology," | |||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | |||
* | |||
* This file is part of Neo4j. | |||
* | |||
* Neo4j is free software: you can redistribute it and/or modify | |||
* it under the terms of the GNU Affero General Public License as | |||
* published by the Free Software Foundation, either version 3 of the | |||
* License, or (at your option) any later version. | |||
* | |||
* This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU Affero General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Affero General Public License | |||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
*/ | |||
package org.neo4j.kernel.ha; | |||
|
|||
/** | |||
* Masters implementation of update puller that does nothing since master should not pull updates. | |||
*/ | |||
public class MasterUpdatePuller implements UpdatePuller | |||
{ | |||
|
|||
public static final MasterUpdatePuller INSTANCE = new MasterUpdatePuller(); | |||
|
|||
private MasterUpdatePuller() | |||
{ | |||
} | |||
|
|||
@Override | |||
public void start() | |||
{ | |||
// no-op | |||
} | |||
|
|||
@Override | |||
public void stop() | |||
{ | |||
// no-op | |||
} | |||
|
|||
@Override | |||
public void pullUpdates() throws InterruptedException | |||
{ | |||
// no-op | |||
} | |||
|
|||
@Override | |||
public boolean tryPullUpdates() throws InterruptedException | |||
{ | |||
return false; | |||
} | |||
|
|||
@Override | |||
public void pullUpdates( Condition condition, boolean assertPullerActive ) | |||
throws InterruptedException | |||
{ | |||
// no-op | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.