Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ services:
restart: unless-stopped

litestream:
image: litestream/litestream:0.3.13
image: litestream/litestream:0.5.17
# The app's user, so the shadow WAL it writes beside the database is
# owned like the database.
user: "1000:1000"
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTROL_PLANE_CONTAINER.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Prerequisites: Docker with Compose v2, a GitHub App and OAuth app as in
```

The response reports the migrations applied, the resident sessions, and the state of the cron
loop and alarm clock. Litestream logs `snapshot written` once the first snapshot is in the
loop and alarm clock. Litestream logs `snapshot complete` once the first snapshot is in the
`backups` bucket. Any S3 client pointed at http://127.0.0.1:9000 with the root credentials lists
both buckets.

Expand Down Expand Up @@ -140,7 +140,7 @@ docker compose rm -sf app litestream
docker volume rm "$(basename "$PWD")_control-plane-data"
docker compose up -d --wait
docker compose logs app | grep litestream.restore
docker compose logs litestream | grep "snapshot written"
docker compose logs litestream | grep "snapshot complete"
```

## Recovering from an unclean stop
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Expand Down
18 changes: 9 additions & 9 deletions packages/control-plane/docker/litestream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@

dbs:
- path: /data/global.db
replicas:
- type: s3
bucket: ${LITESTREAM_BUCKET}
path: control-plane/global.db
endpoint: ${LITESTREAM_ENDPOINT}
force-path-style: true
access-key-id: ${LITESTREAM_ACCESS_KEY_ID}
secret-access-key: ${LITESTREAM_SECRET_ACCESS_KEY}
sync-interval: 1s
replica:
type: s3
bucket: ${LITESTREAM_BUCKET}
path: control-plane/global.db
endpoint: ${LITESTREAM_ENDPOINT}
force-path-style: true
access-key-id: ${LITESTREAM_ACCESS_KEY_ID}
secret-access-key: ${LITESTREAM_SECRET_ACCESS_KEY}
sync-interval: 1s
7 changes: 5 additions & 2 deletions scripts/compose-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ done
echo " ok the cron loop ticked"

log "replication"
"${COMPOSE[@]}" logs --no-color litestream | grep -q "snapshot written" ||
fail "Litestream never wrote a snapshot of the global store"
REPLICATION_DEADLINE=$((SECONDS + 60))
until "${COMPOSE[@]}" logs --no-color litestream | grep -q "snapshot complete"; do
[ "$SECONDS" -lt "$REPLICATION_DEADLINE" ] || fail "Litestream never wrote a snapshot of the global store"
sleep 2
done
Comment thread
coderabbitai[bot] marked this conversation as resolved.
echo " ok Litestream replicated the global store"

log "clean shutdown"
Expand Down
Loading