MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / OpenWAL

Method OpenWAL

consensus/state.go:433–448  ·  view source on GitHub ↗

OpenWAL opens a file to log all consensus messages and timeouts for deterministic accountability.

(walFile string)

Source from the content-addressed store, hash-verified

431// OpenWAL opens a file to log all consensus messages and timeouts for
432// deterministic accountability.
433func (cs *State) OpenWAL(walFile string) (WAL, error) {
434 wal, err := NewWAL(walFile)
435 if err != nil {
436 cs.Logger.Error("failed to open WAL", "file", walFile, "err", err)
437 return nil, err
438 }
439
440 wal.SetLogger(cs.Logger.With("wal", walFile))
441
442 if err := wal.Start(); err != nil {
443 cs.Logger.Error("failed to start WAL", "err", err)
444 return nil, err
445 }
446
447 return wal, nil
448}
449
450//------------------------------------------------------------
451// Public interface for passing messages into the consensus state, possibly causing a state transition.

Callers 2

loadWalFileMethod · 0.95
crashWALandCheckLivenessFunction · 0.45

Calls 5

StartMethod · 0.95
NewWALFunction · 0.70
ErrorMethod · 0.65
SetLoggerMethod · 0.65
WithMethod · 0.65

Tested by 1

crashWALandCheckLivenessFunction · 0.36