mirror of
https://github.com/kopia/kopia.git
synced 2026-03-29 11:32:05 -04:00
prefix each index block name with an inverse timestamp, that decreases over time an can be lexicographically sorted to produce newest blocks first when listing by prefix P
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"math"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -280,7 +281,9 @@ func (bm *Manager) writePackIndexes(ndx packIndexes, replacesBlockBeforeTime *ti
|
||||
suffix = fmt.Sprintf("%v%x", compactedBlockSuffix, replacesBlockBeforeTime.UnixNano())
|
||||
}
|
||||
|
||||
return bm.writeUnpackedBlockNotLocked(buf.Bytes(), packBlockPrefix, suffix, true)
|
||||
inverseTimePrefix := fmt.Sprintf("%016x", math.MaxInt64-time.Now().UnixNano())
|
||||
|
||||
return bm.writeUnpackedBlockNotLocked(buf.Bytes(), packBlockPrefix+inverseTimePrefix, suffix, true)
|
||||
}
|
||||
|
||||
func (bm *Manager) finishAllOpenPacksLocked() error {
|
||||
|
||||
Reference in New Issue
Block a user