litestream 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/litestream/version.rb +1 -1
- data/lib/puma/plugin/litestream.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 908a205fdef352b4a61c74b1a6d0a02217bc596d9b0e2c254bf993c0beab0a6e
|
|
4
|
+
data.tar.gz: 3403399fa91ed7236b96fd52fd56959301138d66327298ec7e75d9becabe43ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d027aaeb1729b542b9a92b3938cde2fc2fcd6be47a44d39661e194dfe75bec17a2aebda1a0a1f18383233eb95b981b1f0065588badeec922e3c66e5485e71d18
|
|
7
|
+
data.tar.gz: d5dbf47b5d0911f5b10d8ba780017634733bc1ab599d596ff45302d9a0aa7488306f8f32fff1156af6edb16ded0ce8d1ff474182bd641f3645af63c2a3f8b037
|
data/README.md
CHANGED
|
@@ -503,6 +503,20 @@ The removed `generations`, `snapshots`, and `wal` command methods and rake tasks
|
|
|
503
503
|
|
|
504
504
|
The 0.5 `restore` command auto-detects both 0.3 and LTX backups and prefers whichever backup is newer. Existing 0.3 `generations/` objects are left in place; you can delete them after the LTX history covers your full retention window. To roll back, reinstall a 0.15.x release of this gem, which bundles Litestream 0.3.
|
|
505
505
|
|
|
506
|
+
### Known issues with Litestream 0.5.17
|
|
507
|
+
|
|
508
|
+
These were found running 0.5.17 in production (see [#84](https://github.com/fractaledmind/litestream-ruby/issues/84)):
|
|
509
|
+
|
|
510
|
+
- **Deploy overlap.** Litestream 0.5.17 takes no lock on the database it replicates. When a deploy starts the new container before stopping the old one, as Kamal does, both run `litestream replicate` against the same database until the old one stops. This can upload a corrupt LTX file. A lock in this gem is planned.
|
|
511
|
+
- **Stalled compaction.** A corrupt LTX file at level 0 makes every compaction that includes it fail, without any error your app would see, and level-0 files then pile up. Keep an eye on the count, for example from a recurring job:
|
|
512
|
+
|
|
513
|
+
```ruby
|
|
514
|
+
Litestream::Commands.ltx("storage/production.sqlite3", json: true, "--level" => "0").size
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
A count that keeps growing means compaction is stuck.
|
|
518
|
+
- **Connection leak.** While compactions keep failing, Litestream 0.5.17 leaks a connection on each attempt, which can exhaust a host's network memory. This is fixed upstream ([benbjohnson/litestream#1500](https://github.com/benbjohnson/litestream/pull/1500)) but not yet released. This gem will move to the first Litestream release that includes the fix.
|
|
519
|
+
|
|
506
520
|
### Using in development
|
|
507
521
|
|
|
508
522
|
By default, if you install the gem and configure via `puma.rb` or `Procfile`, Litestream will not start in development.
|
data/lib/litestream/version.rb
CHANGED
|
@@ -7,12 +7,12 @@ Puma::Plugin.create do
|
|
|
7
7
|
def start(launcher)
|
|
8
8
|
@log_writer = launcher.log_writer
|
|
9
9
|
|
|
10
|
+
in_background do
|
|
11
|
+
monitor_litestream
|
|
12
|
+
end
|
|
13
|
+
|
|
10
14
|
launcher.events.on_booted do
|
|
11
15
|
@litestream_pid = Litestream::Commands.replicate(async: true)
|
|
12
|
-
|
|
13
|
-
in_background do
|
|
14
|
-
monitor_litestream
|
|
15
|
-
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
launcher.events.on_stopped { stop_litestream }
|
|
@@ -45,7 +45,7 @@ Puma::Plugin.create do
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
def litestream_dead?
|
|
48
|
-
Process.waitpid(litestream_pid, Process::WNOHANG)
|
|
48
|
+
Process.waitpid(litestream_pid, Process::WNOHANG) if litestream_pid
|
|
49
49
|
false
|
|
50
50
|
rescue Errno::ECHILD, Errno::ESRCH
|
|
51
51
|
true
|