hhblaze / raft.net Goto Github PK
View Code? Open in Web Editor NEWImplementation of RAFT distributed consensus algorithm among TCP Peers on .NET / .NETStandard / .NETCore / dotnet
License: BSD 2-Clause "Simplified" License
Implementation of RAFT distributed consensus algorithm among TCP Peers on .NET / .NETStandard / .NETCore / dotnet
License: BSD 2-Clause "Simplified" License
Currently one has to call Dispose() on a TcpRaftNode to make it shut down (ungracefully) resulting in:
21.08.2018 15:39:57> [ERROR] [System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.Sockets.Socket'. at System.Net.Sockets.Socket.EndAccept(Byte[]& buffer, Int32& bytesTransferred, IAsyncResult asyncResult) at System.Net.Sockets.TcpListener.EndAcceptTcpClient(IAsyncResult asyncResult) at System.Net.Sockets.TcpListener.<>c.<AcceptTcpClientAsync>b__28_1(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action
1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at Raft.Transport.TcpRaftNode.StartTcpListener()] [] []
Only using in memory entities, still folders are created.
Well the title says it all, I’m only using in memory entities, but still Raft creates a folder. Judging by the size, Raft does not store anything in it. Most files are 0 bytes, one or two are 72 bytes.
Is there a way to prevent that from happening?
I'm busy doing a burn-in test, fixed the previous memory leak, and now run into occasional errors;
`[ERROR] [System.ObjectDisposedException: Cannot access a disposed object.
at System.Threading.TimerQueueTimer.Change(UInt32 dueTime, UInt32 period)
at System.Threading.Timer.Change(Int32 dueTime, Int32 period)
at System.Timers.Timer.UpdateTimer()
at System.Timers.Timer.set_Interval(Double value)
at Raft.TimeMaster.RecalculateTimer()] [Raft.TimeMaster.RecalculateTimer] []`
This occours only once every day on one of the nodes in a 5 node setup. I'm running two days now, and I see it only 3 times now.
Hi,
I'm just curious if there is a way to detect if an instance is running as a Leader? The TCPRaftNode class does not offer such an info?
And by the way.... thanks for sharing this project!
Based on my understanding (RAFT consensus), a RAFT cluster of C(luster)S(ize) = 3 should tolerate the loss of 1 node and still be able to elect a leader.
However, with Raft.NET as soon as the cluster of CS = 3 loses one node (CS = 2) there are no commits until CS is brought back to 3. Basically the absolute minimum of online nodes in a cluster must be 3.
Tested in localhost (Windows 10 .Net Core 2.1) as suggested here: doc
Am I missing something here?
remove LogEntry?
Setup;
Config used;
""EntityName"":""default"", ""DelayedPersistenceMs"":500, ""DelayedPersistenceIsActive"":false, ""InMemoryEntity"":true, ""InMemoryEntityStartSyncFromLatestEntity"":true, ""VerboseRaft"":false, ""VerboseTransport"":false
After running around 10 hours, with each node making changes to the dataset, this error occours;
[ERROR] [System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at DBreeze.LianaTrie.LTrie.Add(Byte[]& key, Byte[]& value, Boolean& WasUpdated, Boolean dontUpdateIfExists) at DBreeze.Transactions.Transaction.Insert[TKey,TValue](String tableName, TKey key, TValue value, Byte[]& refToInsertedValue, Boolean& WasUpdated, Boolean dontUpdateIfExists) at DBreeze.Transactions.Transaction.Insert[TKey,TValue](String tableName, TKey key, TValue value) at Raft.StateLog.AddNextEntryToStateLogByLeader() at Raft.RaftNode.ApplyLogEntry() at Raft.RaftNode.AddLogEntry(Byte[] iData)] [Raft.RaftNode.AddLogEntryLeader] []
All nodes were online, and I'm using the 'InMemoryEntityStartSyncFromLatestEntity' option, so it should not save the entire log right?
In the task manager you can see that only the leader node is using up a lot of memory (3000mb+), the other nodes each take around 300-400mb.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.