Replies: 3 comments 1 reply
-
|
My ReplicaClient is an HTTP client that writes to a Cloudflare Worker, which then stores data in R2. |
Beta Was this translation helpful? Give feedback.
-
|
I've seen similar things while using recent commits; I wonder if this is related to some of the newer development in litestream around using ltx? #645 |
Beta Was this translation helpful? Give feedback.
-
|
I found that I need to manually call the Sync() function before opening the store, otherwise I get the error "page size not initialized yet". The solution is to add db.Sync(ctx) before store.Open(ctx): store := litestream.NewStore([]*litestream.DB{db}, levels)
db.Sync(ctx)
if err := store.Open(ctx); err != nil {
return fmt.Errorf("failed to open database: %w", err)
}Without the manual Sync() call, the database page size isn't properly initialized, causing the initialization error. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I implemented the following code to handle replication using Litestream, but I am not sure if this is the correct way to do it.
I’ve noticed some issues:
Log excerpt:
After this log, no LTX files are sent for several minutes, even though the database continues to receive writes. Eventually replication resumes, but sometimes it does not.
Code:
Questions:
ReplicaClient?Beta Was this translation helpful? Give feedback.
All reactions