MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / followerPrepare

Method followerPrepare

kayak/processes.go:135–165  ·  view source on GitHub ↗
(ctx context.Context, tm *timer.Timer, l *kt.Log, checkPrepare bool)

Source from the content-addressed store, hash-verified

133}
134
135func (r *Runtime) followerPrepare(ctx context.Context, tm *timer.Timer, l *kt.Log, checkPrepare bool) (err error) {
136 defer func() {
137 log.WithField("r", l.Index).WithFields(tm.ToLogFields()).Debug("kayak follower prepare stat")
138 }()
139
140 // decode
141 var req interface{}
142 if req, err = r.doDecodePayload(ctx, l.Data); err != nil {
143 return
144 }
145 tm.Add("decode")
146
147 if checkPrepare {
148 if err = r.doCheck(ctx, req); err != nil {
149 return
150 }
151 tm.Add("check")
152 }
153
154 // write log
155 if err = r.writeWAL(ctx, l); err != nil {
156 return
157
158 }
159 tm.Add("write_wal")
160
161 r.markPendingPrepare(ctx, l.Index)
162 tm.Add("mark")
163
164 return
165}
166
167func (r *Runtime) followerRollback(ctx context.Context, tm *timer.Timer, l *kt.Log) (err error) {
168 var prepareLog *kt.Log

Callers 1

followerApplyMethod · 0.95

Calls 9

doDecodePayloadMethod · 0.95
doCheckMethod · 0.95
writeWALMethod · 0.95
markPendingPrepareMethod · 0.95
WithFieldFunction · 0.92
DebugMethod · 0.80
WithFieldsMethod · 0.80
ToLogFieldsMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected