Skip to content

Commit 711dfe1

Browse files
committed
sql: fix BROKEN for large channelmoves tables.
sql: plugins/sql.c:1749: refresh_by_created_index: Assertion `td->refresh_needs != REFRESH_UNNECESSARY' failed. sql: FATAL SIGNAL 6 (version v26.04rc2) 0x5618e147892e send_backtrace common/daemon.c:38 0x5618e14789bb crashdump common/daemon.c:83 0x7f54d10ea04f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7f54d1138eec __pthread_kill_implementation ./nptl/pthread_kill.c:44 0x7f54d10e9fb1 __GI_raise ../sysdeps/posix/raise.c:26 0x7f54d10d4471 __GI_abort ./stdlib/abort.c:79 0x7f54d10d4394 __assert_fail_base ./assert/assert.c:94 0x7f54d10e2ec1 __GI___assert_fail ./assert/assert.c:103 0x5618e1472725 refresh_by_created_index plugins/sql.c:1749 0x5618e14736af one_refresh_done plugins/sql.c:579 0x5618e1473932 limited_list_done plugins/sql.c:1738 0x5618e1477418 handle_rpc_reply plugins/libplugin.c:1093 0x5618e1477548 rpc_conn_read_response plugins/libplugin.c:1398 0x5618e147ec71 next_plan ccan/ccan/io/io.c:60 0x5618e147ef90 do_plan ccan/ccan/io/io.c:422 0x5618e147f049 io_ready ccan/ccan/io/io.c:439 0x5618e147ffae io_loop ccan/ccan/io/poll.c:470 0x5618e14786af plugin_main plugins/libplugin.c:2461 0x5618e1474b12 main plugins/sql.c:2219 0x7f54d10d5249 __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7f54d10d5304 __libc_start_main_impl ../csu/libc-start.c:360 0x5618e1470710 ??? _start+0x20:0 0xffffffffffffffff ??? ???:0 Changelog-Fixed: sql: fix BROKEN for large channelmoves tables. Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1 parent e8b34e3 commit 711dfe1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

plugins/sql.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,7 @@ static struct command_result *limited_list_done(struct command *cmd,
17261726
struct table_desc *td = dbq->tables[0];
17271727
struct command_result *ret;
17281728
size_t num_entries;
1729+
bool was_limited;
17291730

17301731
ret = process_json_result(cmd, buf, result, td, false,
17311732
&td->last_created_index,
@@ -1734,8 +1735,11 @@ static struct command_result *limited_list_done(struct command *cmd,
17341735
if (ret)
17351736
return ret;
17361737

1738+
was_limited = num_entries == sql->limit_per_list;
1739+
if (!was_limited)
1740+
td->refresh_needs = REFRESH_UNNECESSARY;
17371741
/* If we got the number we asked for, we need to ask again. */
1738-
return one_refresh_done(cmd, dbq, num_entries == sql->limit_per_list);
1742+
return one_refresh_done(cmd, dbq, was_limited);
17391743
}
17401744

17411745
/* The simplest case: append-only lists */
@@ -1748,7 +1752,6 @@ static struct command_result *refresh_by_created_index(struct command *cmd,
17481752

17491753
/* Since we're relying on watches, mark refreshing unnecessary to start */
17501754
assert(td->refresh_needs != REFRESH_UNNECESSARY);
1751-
td->refresh_needs = REFRESH_UNNECESSARY;
17521755

17531756
req = jsonrpc_request_start(cmd, td->cmdname,
17541757
limited_list_done, forward_error,

tests/test_plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4410,7 +4410,6 @@ def test_sql_deprecated(node_factory, bitcoind):
44104410
assert ret == {'rows': [[1]]}
44114411

44124412

4413-
@pytest.mark.xfail(strict=True)
44144413
def test_sql_limit_per_list(node_factory):
44154414
l1, l2, l3 = node_factory.line_graph(
44164415
3, wait_for_announce=True, opts=[{}, {"dev-sqllistlimit": 10}, {}]

0 commit comments

Comments
 (0)