Skip to content

Conversation

@RCasatta
Copy link
Contributor

@RCasatta RCasatta commented Nov 4, 2025

Cockroach db is a database that ~speaks postgresql on the wire but it's easier to build a cluster with it.
So i thought to try it with the lightning node.

This are the changes needed to run it, I tested this on 25.09 modded with this changes.

The changes are AI generated, I just verified the executable can be launched with those and cockroach db.

Another thing to mention is this notice from the logs is this:

Nov 04 15:03:27 unique lightning-cockroach-start[464556]: NOTICE: using sequential values in a primary key does not perform as well as using random UUIDs. See https://www.cockroachlabs.com/docs/v23.1/serial.html

@RCasatta RCasatta marked this pull request as draft November 4, 2025 17:05
@RCasatta
Copy link
Contributor Author

RCasatta commented Nov 4, 2025

Even if the process starts, error pops up very soon:

Nov 04 17:57:59 unique lightning-cockroach-start[727854]: 2025-11-04T16:57:59.739Z **BROKEN** lightningd: Error executing statement: ERROR:  restart transaction: TransactionRetryWithProtoRefreshError: TransactionAbortedError(ABORT_REASON_CLIENT_REJECT): "sql txn" meta={id=3f790975 key=/Table/254/1/1121337576518909953/0 pri=0.03525419 epo=0 ts=1762275470.838116307,0 min=1762275470.838116307,0 seq=227} lock=true stat=PENDING rts=1762275470.838116307,0 wto=false gul=1762275471.338116307,0?HINT:  See: https://www.cockroachlabs.com/docs/v23.1/transaction-retry-error-reference.html#abort_reason_client_reject?

I think the change to support a distributed database is much more impactful and would require transaction retry logic everywhere in the codebase...

UPDATE: I take this back, my cockroach db setup was wrong causing this kind of error, for now it seems that previous commits are enough to run the node with cockroach db

@RCasatta
Copy link
Contributor Author

RCasatta commented Nov 6, 2025

Nov 04 15:03:27 unique lightning-cockroach-start[464556]: NOTICE: using sequential values in a primary key does not perform as well as using random UUIDs. See https://www.cockroachlabs.com/docs/v23.1/serial.html

These notices are printed because all the migrations are executed but in the latest schema none of the primary keys use BIGSERIAL thus this NOTICE is not to be considered

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

Successfully merging this pull request may close these issues.

1 participant