Commit 98bc1e6d authored by Marcin's avatar Marcin
Browse files

add 'START' state to synchronization states

'START' state is the start state of synchronization.
Inside this state decision is made in which state synchronization
muste go next. During this state synchronization is not synchronizing
blocks, only wait for event which claryfy what is the most optimal next
state. 'START' state solves the problem with breaking LIVE
synchronization with CTRL+C: previously at the begining synchronization
was started in P2P state, what fore to disable foreign key, and in
consequence the FK have to be restored in the next state what takes a
lot of time. Now, during leaving the 'START' state decision is made if
is better go to LIVE or P2P/REINDEX. Decision is made on expected
number of blocks to sync to reach the network HEAD BLOCK. A new
parameter 'psql-livesync-threshold' was added to sql_serializer: if
number of expected blocks is less or equal than the value of the threshold then
synchronization will move to live sync, otheriwse to it will move to
P2P/REINDEX.
parent de109271
Loading
Loading
Loading
Loading