tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

libsql: downgrade failed prefetch log to debug #1646

Closed LucioFranco closed 1 month ago

LucioFranco commented 1 month ago

Users are seeing a warning message come up when a fresh database client tries to sync. Subsequent calls to sync don't trigger this warning log and in fact there is nothing to be worried about if this log fires because its normal to see this on the first call to sync.

Example logs showing this firing:

     Running `target/debug/examples/remote_sync`
2024-08-07T21:39:26.287453Z  INFO libsql::replication::remote_client: Attempting to perform handshake with primary.
[libsql/src/replication/remote_client.rs:92:27] &self.session_token = None
[libsql/src/replication/remote_client.rs:92:56] &Some(hello.session_token.clone()) = Some(
    b"e5c97d87-5ac7-089c-013f-31079f959e84",
)
2024-08-07T21:39:26.786669Z  WARN libsql::replication::remote_client: Frames prefetching failed because of new session token returned by handshake
second sync now
2024-08-07T21:39:29.219577Z  INFO libsql::replication::remote_client: Attempting to perform handshake with primary.
[libsql/src/replication/remote_client.rs:92:27] &self.session_token = Some(
    b"e5c97d87-5ac7-089c-013f-31079f959e84",
)
[libsql/src/replication/remote_client.rs:92:56] &Some(hello.session_token.clone()) = Some(
    b"e5c97d87-5ac7-089c-013f-31079f959e84",
)