diff --git a/server/internal/postgresx/acquisition_value_hints.go b/server/internal/postgresx/acquisition_value_hints.go index df2e75a1a..a656536a5 100644 --- a/server/internal/postgresx/acquisition_value_hints.go +++ b/server/internal/postgresx/acquisition_value_hints.go @@ -93,7 +93,8 @@ func (a Acquisition) CompleteValueHint(ctx context.Context, scope collectnative. } var retryAt any if !retry.IsZero() { - retryAt = retry.UTC() + // timestamptz stores microseconds and rounds; truncate so retry_at round-trips exactly. + retryAt = retry.UTC().Truncate(time.Microsecond) } result, err := tx.ExecContext(ctx, `UPDATE cao_acquisition_value_hints SET processed=CASE WHEN $6::timestamptz IS NULL THEN greatest(processed,$4) ELSE processed END, diff --git a/server/internal/postgresx/acquisition_value_hints_test.go b/server/internal/postgresx/acquisition_value_hints_test.go index 4a677e649..d7e5022ed 100644 --- a/server/internal/postgresx/acquisition_value_hints_test.go +++ b/server/internal/postgresx/acquisition_value_hints_test.go @@ -47,7 +47,7 @@ func TestNativeValueHintsFenceConcurrentInvalidationAndAcknowledgement(t *testin if err := a.InvalidateValue(t.Context(), scope); err != nil { t.Fatal(err) } - now := time.Now().UTC() + now := time.Now().UTC().Truncate(time.Microsecond) if err := b.CompleteValueHint(t.Context(), scope, hint.Dirty, now, time.Time{}); err != nil { t.Fatal(err) }