Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added OpenQuestions.md file to log ideas and questions to address
Fix 'PrevLogIndex' in AppendEntries so it properly covers empty log cornercase Moved timer reinitialization at the end of event to prevent triggering too fast when timeout is set to 0
- Loading branch information
Showing
15 changed files
with
164 additions
and
64 deletions.
There are no files selected for viewing
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
** RAFTiNG Open questions ** | ||
============================= | ||
|
||
This document list questions that should be answered in the course of the project. | ||
|
||
|
||
** Stability ** | ||
- how can RAFTiNG handle configuration errors? |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// <copyright file="LogReplicationTest.cs" company="Cyrille DUPUYDAUBY"> | ||
// Copyright 2013 Cyrille DUPUYDAUBY | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// </copyright> | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
namespace RAFTiNG.Tests.Unit | ||
{ | ||
using System.Threading; | ||
|
||
using NFluent; | ||
|
||
using NUnit.Framework; | ||
|
||
[TestFixture] | ||
public class LogReplicationTest | ||
{ | ||
[Test] | ||
public void EmptyLogIsfilledTest() | ||
{ | ||
using (Helpers.InitLog4Net()) | ||
{ | ||
var settings = Helpers.BuildNodeSettings("1", new[] { "1", "2" }); | ||
settings.TimeoutInMs = Timeout.Infinite; | ||
var logReplicator = new LogReplicator<string>(); | ||
var middleware = new Middleware(); | ||
|
||
using (var node = new Node<string>(settings)) | ||
{ | ||
settings = Helpers.BuildNodeSettings("2", new[] { "1", "2" }); | ||
settings.TimeoutInMs = 1; | ||
var leader = new Node<string>(settings); | ||
leader.SetMiddleware(middleware); | ||
node.SetMiddleware(middleware); | ||
node.Initialize(); | ||
leader.Initialize(); | ||
Thread.Sleep(30); | ||
|
||
// should stay follower | ||
Check.ThatEnum(node.Status).IsEqualTo(NodeStatus.Follower); | ||
|
||
Check.ThatEnum(leader.Status).IsEqualTo(NodeStatus.Leader); | ||
} | ||
} | ||
} | ||
} | ||
|
||
public class LogReplicator<T> | ||
{ | ||
} | ||
} |
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.