diff --git a/doc/logbook.md b/doc/logbook.md index dd552ac..43545b8 100644 --- a/doc/logbook.md +++ b/doc/logbook.md @@ -4,6 +4,21 @@ Add partitioning and process kill nemeses to flush out more errors and observe behaviors. + +Workaround `waitForFirstSync()` by sleeping for 1s +- slightly changes behavior of kill nemesis + - minimum of 1s interval between kills vs a possibly, random, interval of 0 +- slightly changes startup behavior + - 1s delay avoids the sometimes, random, initial transactions before/during setup + + +Possible Issues +- frequent, extraneous?, duplicate `SyncStatus` stream messages + ```log + [2:13:41.301] [powersync_endpoint] FINEST: statusStream: SyncStatus + [2:13:41.301] [powersync_endpoint] FINEST: statusStream: SyncStatus + ``` + --- ### Known Errors In New CrudTransactionConnector @@ -11,7 +26,8 @@ Add partitioning and process kill nemeses to flush out more errors and observe b - PostgreSQL could not serialize access due to concurrent update - Max retries, 10, exceeded -TODO: Implement exponential backoff? +TODO: Implement a try hard, try harder, 'reverse' exponential backoff? +- fair and polite ---- diff --git a/jepsen/src/powersync/powersync.clj b/jepsen/src/powersync/powersync.clj index a2a8173..9a04da6 100644 --- a/jepsen/src/powersync/powersync.clj +++ b/jepsen/src/powersync/powersync.clj @@ -4,7 +4,8 @@ [db :as db] [control :as c]] [jepsen.control - [util :as cu]])) + [util :as cu]] + [jepsen.util :as util])) (def install-dir "Directory to install into." @@ -92,6 +93,9 @@ :logfile log-file :pidfile pid-file} bin-path)) + ; TODO: not possible to waitForFirstSync() in powersync_endpoint, so sleep here + (info "Sleeping for 1 second to mimic waitForFirstSync()") + (util/sleep 1000) :started))) (kill! diff --git a/powersync_endpoint/lib/db.dart b/powersync_endpoint/lib/db.dart index 85c5402..199ea40 100644 --- a/powersync_endpoint/lib/db.dart +++ b/powersync_endpoint/lib/db.dart @@ -52,8 +52,11 @@ Future initDb() async { await db.connect(connector: connector); log.info('db connected, connector: $connector, status: ${db.currentStatus}'); - await db.waitForFirstSync(); - log.info('db first sync completed, status: ${db.currentStatus}'); + // TODO: disappeared from API? + // https://github.com/powersync-ja/powersync.dart/issues/131 + log.warning("not waitForFirstSync()'ing"); + // await db.waitForFirstSync(); + // log.info('db first sync completed, status: ${db.currentStatus}'); // log PowerSync status changes // monitor for upload error messages, check if they're ignorable