What happens if the log index number reaches the maximum variable value?

71 views
Skip to first unread message

Ivan Pim

unread,
May 7, 2018, 8:38:04 AM5/7/18
to raft-dev
Hello,

Sorry if my question is not relevant.
But I have a question on log index/log compaction when using the Raft algorithm.

The Raft paper says that when we make a snapshot to compact the logs, we keep the following info in the snapshot:
  • Last included index (which is just a sequential number of all committed commands to the state machine)
  • Last included term
  • And the state machine data
My question is (I know it's more theoretical) - what if the last included index (log index) exceeds the max integer size (e.g. 18446744073709551615 for uint64 type)?
I guess there should be some mechanism to reset the last included index in a practical implementation.
Same goes for the last included term but reaching such a limit sounds highly improbable.

Thank you!

Oren Eini (Ayende Rahien)

unread,
May 7, 2018, 8:44:18 AM5/7/18
to raft...@googlegroups.com
You are sending 1 million events per second.
At this rate, it will take you 584,942 years to run out.

You can probably ignore this issue.


Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "raft-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raft-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henrik Ingo

unread,
May 8, 2018, 3:35:39 AM5/8/18
to raft...@googlegroups.com
Hi Ivan

As Oren pointed out, you probably shouldn't worry about this. BUT I
wanted to point out that an equivalent choice would be to use
term+index as the index, where the index part would reset to zero
after each new term.

henrik

On Mon, May 7, 2018 at 3:38 PM, Ivan Pim <ivan.pim...@gmail.com> wrote:
> --
> You received this message because you are subscribed to the Google Groups
> "raft-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to raft-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
henri...@avoinelama.fi
+358-40-5697354 skype: henrik.ingo irc: hingo
www.openlife.cc

My LinkedIn profile: http://fi.linkedin.com/pub/henrik-ingo/3/232/8a7
Reply all
Reply to author
Forward
0 new messages