Skip to content

Conversation

@github-actions
Copy link

Backport of #10449


Fix bug where setSelfNode compared only the seconds component of
timestamps instead of the full timestamp. This caused the node to
attempt persisting an older timestamp than what existed in the
database during restart, resulting in "sql: no rows in result set"
errors.

Fixes a flake:

https://github.com/lightningnetwork/lnd/actions/runs/20183761355/job/57949717763

The issue occurred when:

  1. Node starts with timestamp T1 (e.g., 10:00:05)
  2. Runtime update creates newer timestamp T2 (e.g., 10:00:30)
  3. Node restarts, time.Now() returns T3 (e.g., 10:01:02)
  4. Comparison srcNode.LastUpdate.Second() >= nodeLastUpdate.Second()
    evaluated 30 >= 2, causing nodeLastUpdate to be set to 10:00:31
  5. This older timestamp failed the UpsertSourceNode WHERE clause

Fix bug where setSelfNode compared only the seconds component of
timestamps instead of the full timestamp. This caused the node to
attempt persisting an older timestamp than what existed in the
database during restart, resulting in "sql: no rows in result set"
errors.

(cherry picked from commit 865e155)
(cherry picked from commit e5b0704)
@ziggie1984 ziggie1984 force-pushed the backport-10449-to-v0.20.x-branch branch from 7fce2f7 to 99b136e Compare December 16, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants