Skip to content

Commit 5d926b3

Browse files
authored
Merge pull request #9939 from ellemouton/graphSQL15-prune-log
[15] graph/db: SQL prune log
2 parents fb720c1 + e875183 commit 5d926b3

File tree

9 files changed

+751
-6
lines changed

9 files changed

+751
-6
lines changed

docs/release-notes/release-notes-0.20.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ circuit. The indices are only available for forwarding events saved after v0.20.
8888
* [6](https://github.com/lightningnetwork/lnd/pull/9936)
8989
* [7](https://github.com/lightningnetwork/lnd/pull/9937)
9090
* [8](https://github.com/lightningnetwork/lnd/pull/9938)
91+
* [9](https://github.com/lightningnetwork/lnd/pull/9939)
9192

9293
## RPC Updates
9394

graph/db/graph_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ func TestDisconnectBlockAtHeight(t *testing.T) {
513513
t.Parallel()
514514
ctx := context.Background()
515515

516-
graph := MakeTestGraph(t)
516+
graph := MakeTestGraphNew(t)
517517

518518
sourceNode := createTestVertex(t)
519519
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
@@ -1685,7 +1685,7 @@ func TestGraphPruning(t *testing.T) {
16851685
t.Parallel()
16861686
ctx := context.Background()
16871687

1688-
graph := MakeTestGraph(t)
1688+
graph := MakeTestGraphNew(t)
16891689

16901690
sourceNode := createTestVertex(t)
16911691
if err := graph.SetSourceNode(ctx, sourceNode); err != nil {
@@ -2440,14 +2440,18 @@ func TestStressTestChannelGraphAPI(t *testing.T) {
24402440
t.Parallel()
24412441
ctx := context.Background()
24422442

2443-
graph := MakeTestGraph(t)
2443+
graph := MakeTestGraphNew(t)
24442444

24452445
node1 := createTestVertex(t)
24462446
require.NoError(t, graph.AddLightningNode(ctx, node1))
24472447

24482448
node2 := createTestVertex(t)
24492449
require.NoError(t, graph.AddLightningNode(ctx, node2))
24502450

2451+
// We need to update the node's timestamp since this call to
2452+
// SetSourceNode will trigger an upsert which will only be allowed if
2453+
// the newest LastUpdate time is greater than the current one.
2454+
node1.LastUpdate = node1.LastUpdate.Add(time.Second)
24512455
require.NoError(t, graph.SetSourceNode(ctx, node1))
24522456

24532457
type chanInfo struct {
@@ -3291,7 +3295,7 @@ func TestPruneGraphNodes(t *testing.T) {
32913295
t.Parallel()
32923296
ctx := context.Background()
32933297

3294-
graph := MakeTestGraph(t)
3298+
graph := MakeTestGraphNew(t)
32953299

32963300
// We'll start off by inserting our source node, to ensure that it's
32973301
// the only node left after we prune the graph.
@@ -4006,7 +4010,7 @@ func TestBatchedAddChannelEdge(t *testing.T) {
40064010
t.Parallel()
40074011
ctx := context.Background()
40084012

4009-
graph := MakeTestGraph(t)
4013+
graph := MakeTestGraphNew(t)
40104014

40114015
sourceNode := createTestVertex(t)
40124016
require.Nil(t, graph.SetSourceNode(ctx, sourceNode))

0 commit comments

Comments
 (0)