diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index 9a0c0266df46..e75eb8f06eae 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -1860,7 +1860,9 @@ " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", - " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).", + "", + "NOTE: until v25.12, the `uncleaned` field contained all entries not removed (e.g. in `failedforwards` it counted all forwards, not just failed ones). This was an interface only an engineer could love, so it was fixed." ] }, "age": { @@ -1892,13 +1894,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of successful forwards deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of successful forwards *not* deleted (too new)." ] } } @@ -1914,13 +1916,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of failed forwards deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of failed forwards *not* deleted (too new)." ] } } @@ -1936,13 +1938,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of successful payments deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of successful forwards *not* deleted (too new)." ] } } @@ -1958,13 +1960,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of unsuccessful payments deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of unsuccessful payments *not* deleted (too new)." ] } } @@ -1980,13 +1982,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of paid invoices deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of paid invoices *not* deleted (too new)." ] } } @@ -2002,13 +2004,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of expired invoices deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of expired invoices *not* deleted (too new)." ] } } diff --git a/doc/schemas/autoclean-once.json b/doc/schemas/autoclean-once.json index ecb6476c5fee..069e019b4091 100644 --- a/doc/schemas/autoclean-once.json +++ b/doc/schemas/autoclean-once.json @@ -30,7 +30,9 @@ " * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).", " * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).", " * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).", - " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status)." + " * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).", + "", + "NOTE: until v25.12, the `uncleaned` field contained all entries not removed (e.g. in `failedforwards` it counted all forwards, not just failed ones). This was an interface only an engineer could love, so it was fixed." ] }, "age": { @@ -62,13 +64,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of successful forwards deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of successful forwards *not* deleted (too new)." ] } } @@ -84,13 +86,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of failed forwards deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of failed forwards *not* deleted (too new)." ] } } @@ -106,13 +108,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of successful payments deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of successful forwards *not* deleted (too new)." ] } } @@ -128,13 +130,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of unsuccessful payments deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of unsuccessful payments *not* deleted (too new)." ] } } @@ -150,13 +152,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of paid invoices deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of paid invoices *not* deleted (too new)." ] } } @@ -172,13 +174,13 @@ "cleaned": { "type": "u64", "description": [ - "Total number of deletions done this run." + "The number of expired invoices deleted." ] }, "uncleaned": { "type": "u64", "description": [ - "The total number of entries *not* deleted this run." + "The number of expired invoices *not* deleted (too new)." ] } } diff --git a/plugins/autoclean.c b/plugins/autoclean.c index f1561252252e..5e423b2413c2 100644 --- a/plugins/autoclean.c +++ b/plugins/autoclean.c @@ -511,13 +511,11 @@ static struct command_result *list_done(struct command *cmd, variant = ops->get_variant(buf, t, subsystem, ×tamp); if (!variant) { - subsystem->num_uncleaned++; continue; } /* Continue if we don't care. */ if (variant->age == 0) { - subsystem->num_uncleaned++; continue; } diff --git a/tests/test_plugin.py b/tests/test_plugin.py index bc3e6c9178f5..ad8f827a47be 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -3078,7 +3078,7 @@ def test_autoclean_once(node_factory): # Make sure > 1 second old! time.sleep(2) assert (l1.rpc.autoclean_once('failedpays', 1) - == {'autoclean': {'failedpays': {'cleaned': 1, 'uncleaned': 1}}}) + == {'autoclean': {'failedpays': {'cleaned': 1, 'uncleaned': 0}}}) assert l1.rpc.autoclean_status() == {'autoclean': {'failedpays': {'enabled': False, 'cleaned': 1}, 'succeededpays': {'enabled': False, @@ -3106,7 +3106,7 @@ def test_autoclean_once(node_factory): 'paidinvoices': {'enabled': False, 'cleaned': 0}}} assert (l2.rpc.autoclean_once('failedforwards', 1) - == {'autoclean': {'failedforwards': {'cleaned': 1, 'uncleaned': 1}}}) + == {'autoclean': {'failedforwards': {'cleaned': 1, 'uncleaned': 0}}}) assert l2.rpc.autoclean_status() == {'autoclean': {'failedpays': {'enabled': False, 'cleaned': 0}, 'succeededpays': {'enabled': False, @@ -3134,7 +3134,7 @@ def test_autoclean_once(node_factory): 'paidinvoices': {'enabled': False, 'cleaned': 0}}} assert (l3.rpc.autoclean_once('expiredinvoices', 1) - == {'autoclean': {'expiredinvoices': {'cleaned': 1, 'uncleaned': 1}}}) + == {'autoclean': {'expiredinvoices': {'cleaned': 1, 'uncleaned': 0}}}) assert l3.rpc.autoclean_status() == {'autoclean': {'failedpays': {'enabled': False, 'cleaned': 0}, 'succeededpays': {'enabled': False,