[#2161] pilorama: Do not apply already existing operations

Speeds up synchronization a bit.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2022-12-12 14:38:41 +03:00 committed by Anton Nikiforov
parent 3bb5a320d7
commit e5c304536b
2 changed files with 7 additions and 0 deletions

View file

@ -23,6 +23,7 @@ Changelog for NeoFS Node
- `neofs-cli container delete` command pre-checks container ownership (#2106)
- Policer cache size is now 1024 (#2158)
- Tree service now synchronizes with container nodes in a random order (#2127)
- Pilorama no longer tries to apply already applied operations (#2161)
### Fixed
- Open FSTree in sync mode by default (#1992)

View file

@ -299,6 +299,12 @@ func (t *boltForest) applyOperation(logBucket, treeBucket *bbolt.Bucket, lm *Log
var tmp LogMove
var cKey [17]byte
var logKey [8]byte
binary.BigEndian.PutUint64(logKey[:], lm.Time)
if logBucket.Get(logKey[:]) != nil {
return nil
}
c := logBucket.Cursor()
key, value := c.Last()