Skip to content

Commit

Permalink
CR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed May 24, 2023
1 parent f4b78a9 commit b7f1cd4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
9 changes: 0 additions & 9 deletions ledger/acctupdates.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"sort"
"strings"
"sync"
"sync/atomic"
"time"

"github.com/algorand/go-deadlock"
Expand Down Expand Up @@ -1656,14 +1655,6 @@ func (au *accountUpdates) commitRound(ctx context.Context, tx trackerdb.Transact
offset := dcc.offset
dbRound := dcc.oldBase

defer func() {
if err != nil {
if dcc.catchpointFirstStage && dcc.enableGeneratingCatchpointFiles {
atomic.StoreInt32(dcc.catchpointDataWriting, 0)
}
}
}()

_, err = tx.ResetTransactionWarnDeadline(ctx, time.Now().Add(accountsUpdatePerRoundHighWatermark*time.Duration(offset)))
if err != nil {
return err
Expand Down
1 change: 0 additions & 1 deletion ledger/catchpointtracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ func (ct *catchpointTracker) prepareCommit(dcc *deferredCommitContext) error {
if ct.enableGeneratingCatchpointFiles && dcc.catchpointFirstStage {
// store non-zero ( all ones ) into the catchpointWriting atomic variable to indicate that a catchpoint is being written
atomic.StoreInt32(&ct.catchpointDataWriting, int32(-1))
dcc.catchpointDataWriting = &ct.catchpointDataWriting
}

dcc.committedRoundDigests = make([]crypto.Digest, dcc.offset)
Expand Down
7 changes: 1 addition & 6 deletions ledger/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,6 @@ type deferredCommitRange struct {
// a catchpoint data file, in this commit cycle iteration.
catchpointFirstStage bool

// catchpointDataWriting is a pointer to a variable with the same name in the
// catchpointTracker. It's used in order to reset the catchpointDataWriting flag from
// the acctupdates's prepareCommit/commitRound (which is called before the
// corresponding catchpoint tracker method.
catchpointDataWriting *int32

// enableGeneratingCatchpointFiles controls whether the node produces catchpoint files or not.
enableGeneratingCatchpointFiles bool

Expand Down Expand Up @@ -544,6 +538,7 @@ func (tr *trackerRegistry) commitRound(dcc *deferredCommitContext) error {
err = lt.prepareCommit(dcc)
if err != nil {
tr.log.Errorf(err.Error())
break
}
}
if err != nil {
Expand Down

0 comments on commit b7f1cd4

Please sign in to comment.