graph/db+sqldb: make node migration idempotent

In this commit, the graph SQL migration is updated so that the node
migration step is retry-safe. This is done by using migration specific
logic & queries that do not use the same node-update-constraint as the
normal node upsert logic. For normal "run-time" logic, we always expect
a node update to have a newer timestamp than any previously stored one.
But for the migration, we will only ever be dealing with a single
announcement for a given node & to make things retry-safe, we dont want
the query to error if we re-insert the exact same node.
This commit is contained in:
Elle Mouton committed 2025-09-01 07:56:34 +02:00
1 parent 2c8ac0c92c
commit ddea6d59ce
6 files changed
+175 -5

No files matched your search

-2
View File
@@ -155,7 +155,6 @@ func TestMigrateGraphToSQL(t *testing.T) {
expGraphStats: graphStats{
numNodes: 6,
},
expNotRetrySafety: true,
},
{
name: "source node",
@@ -173,7 +172,6 @@ func TestMigrateGraphToSQL(t *testing.T) {
numNodes: 1,
srcNodeSet: true,
},
expNotRetrySafety: true,
},
{
name: "channel with no policies",