libsql / sqld

LibSQL with extended capabilities like HTTP protocol, replication, and more.
https://libsql.org
902 stars 38 forks source link

No result to take panic in replication sync? #439

Closed penberg closed 1 year ago

penberg commented 1 year ago
Welcome to sqld!
version: 0.15.0
commit SHA: 076f691f5f54c22763659cd2777efb73acc71ef4
build date: 2023-05-22
This software is in BETA version.
If you encounter any bug, please open an issue at https://github.com/libsql/sqld/issues
config:
    - mode: replica (primary at https://148ed5d0c35128.vm.turso-raf-skylight-dev-chocsproc.internal:5001/)
    - database path: /data/iku.db
    - extensions path: /var/lib/extensions
    - listening for HTTP requests on: [::]:8080
    - listening for PostgreSQL wire on: [::]:5432
    - grpc_tls: no
2023-05-28T23:46:15.331198Z  INFO sqld::replication::replica::replicator: Attempting to perform handshake with primary.
2023-05-28T23:46:15.339561Z  INFO sqld: Using JWT-based authentication
2023-05-28T23:46:15.339873Z  WARN sqld: No server heartbeat configured
2023-05-28T23:46:15.340072Z  INFO sqld::http: listening for HTTP requests on [::]:8080
2023-05-28T23:46:15.341251Z  INFO sqld::hrana: Listening for Hrana connections on [::]:2023
2023-05-28T23:46:15.675932Z  INFO sqld::http: got request: GET /
2023-05-28T23:46:15.676368Z  INFO sqld::hrana: Received HTTP upgrade connection #0
2023-05-28T23:46:15.718346Z  INFO sqld::hrana: HTTP upgrade connection #0 was terminated
thread 'tokio-runtime-worker' panicked at 'no result to take', sqld/src/replication/replica/hook.rs:67:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-05-28T23:46:16.512929Z  WARN sqld::replication::replica::replicator: replication error: channel closed
Error: task 5 panicked
Starting clean up.
MarinPostma commented 1 year ago

I don't think this issue still exists on main

penberg commented 1 year ago

@MarinPostma Do you mean you think this is already fixed in main? Which commit?

MarinPostma commented 1 year ago

I would say that it was due to the sloppy WAL methods, which are now gone with https://github.com/libsql/sqld/commit/76911a94e272b961dfff424a47f392082906c754

Let's keep an eye open when this gets deployed

athoscouto commented 1 year ago

@MarinPostma got this problem with 4255cb3eb0bef465c7b1ca772534c5726447f5c3 (#440). Part of logs:

thread 'tokio-runtime-worker' panicked at 'no result to take', sqld/src/replication/replica/hook.rs:73:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-06-01T14:20:37.660878Z  WARN sqld::replication::replica::replicator: replication error: channel closed
Error: task 4 panicked
MarinPostma commented 1 year ago

This part of the code has been rewritten, closing