Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiccups when closed channels are being forgotten #7962

Open
michael1011 opened this issue Dec 20, 2024 · 3 comments
Open

Hiccups when closed channels are being forgotten #7962

michael1011 opened this issue Dec 20, 2024 · 3 comments

Comments

@michael1011
Copy link
Contributor

When closed channels with lots of updates are being forgotten, the CLN RPC freezes until the deletion is done.

From @rustyrussell:

I strongly suspect it's this:
stmt = db_prepare_v2(w->db, SQL("DELETE FROM channel_htlcs "
"WHERE channel_id=?"));

This is because there's no index for that exact thing, so this causes a sweep of the entire table. Fix is obvious: add another index...

@whitslack
Copy link
Collaborator

Do you not have a unique index on (channel_id, channel_htlc_id, direction)? My channel_htlcs table has that index.

@michael1011
Copy link
Contributor Author

michael1011 commented Feb 5, 2025

Yes, that index exists. And even if it didn't, I wouldn't want to start creating indexes myself by hand

@whitslack
Copy link
Collaborator

Yes, that index exists.

So there would be nothing to gain by adding an index on solely channel_id. It would only slow down writes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants