fix: head fingerprint covers the whole first line; hub no longer drops traefik generations whose first 64 bytes repeat (2.2.1)
CI / Format and vet (push) Successful in 1m15s
CI / Dependency audit (push) Successful in 36s
CI / Tests (Linux, race detector) (push) Successful in 2m7s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 18s
Release / Publish tags (probe) (push) Successful in 18s
Release / Gitea release (push) Successful in 4s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-11-16 20:57:25 -03:00
1 parent c2bee81bc1
commit 87178dbc94
7 files changed
+43 -6

No files matched your search

+7
View File
@@ -91,4 +91,11 @@ func TestSameHeadCopytruncate(t *testing.T) {
if sameHead(old, store.Offset{Inode: 7, Offset: 500, FP: 222, FPLen: 64}) {
t.Fatal("truncated and regrown file must not be a duplicate")
}
// production 2026-11-16: the saved head had 64 bytes, the new probe sends longer ones
if sameHead(old, store.Offset{Inode: 7, Offset: 500, FP: 333, FPLen: 1024}) {
t.Fatal("fingerprints of different lengths must not be taken for the same file")
}
if !sameHead(store.Offset{Inode: 7, Offset: 900}, store.Offset{Inode: 7, Offset: 500, FP: 1, FPLen: 64}) {
t.Fatal("without a saved fingerprint the offset decides")
}
}
+6 -4
View File
@@ -248,12 +248,14 @@ func (r *Runner) feedLocked(src string, text []byte, end store.Offset) bool {
// restarts the offsets at 0: without comparing the head fingerprint every new
// line below the old high-water mark would be taken for a duplicate and lost
// until the file regrew past it. Fingerprints of different lengths cannot be
// compared and count as the same file.
// compared: they count as different generations (at worst a replay across a
// generation start is counted twice, never a whole generation lost). Without a
// fingerprint on either side (old state) the offset alone decides.
func sameHead(a, b store.Offset) bool {
if a.FPLen > 0 && a.FPLen == b.FPLen {
return a.FP == b.FP
if a.FPLen == 0 || b.FPLen == 0 {
return true
}
return true
return a.FPLen == b.FPLen && a.FP == b.FP
}
// ApplyBatch applies the lines of a batch under the commit mutex.
+1 -1
View File
@@ -2,4 +2,4 @@ package app
// Version is the release version (SemVer). Release builds may override it with
// -ldflags "-X .../internal/app.Version=...".
var Version = "2.2.0"
var Version = "2.2.1"