-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #740 from samply/release-v0.17.7
Release v0.17.7
- Loading branch information
Showing
22 changed files
with
182 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
target | ||
/.lein-* | ||
.nrepl-port | ||
/queries | ||
/generate-docs.sh | ||
/fill-store.sh | ||
/load-test.sh | ||
/start-db.sh | ||
/kube* | ||
/nginx.conf | ||
.cpcache | ||
.cache | ||
.env | ||
blaze-load-tests/node_modules | ||
.nrepl-port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Database Migration | ||
|
||
If Blaze starts up with the following error message: | ||
|
||
``` | ||
Incompatible index store version <x> found. This version of Blaze needs | ||
version <y>. | ||
Either use an older version of Blaze which is compatible with index store | ||
version <x> or do a database migration described here: | ||
https://github.com/samply/blaze/tree/master/docs/database/migration.md | ||
``` | ||
|
||
you need to do a migration of the index store. | ||
|
||
Blaze will do that migration automatically at startup if you delete the index store. So all you need to do is to make a | ||
backup of all the data Blaze has written to disk, **plan for a downtime**, delete the index store and start Blaze normally. | ||
|
||
## Deleting the Index Store | ||
|
||
Please start Blaze with a shell assuming that you use the volume `blaze-data`: | ||
|
||
```sh | ||
docker run -it -v blaze-data:/app/data samply/blaze:0.17 sh | ||
``` | ||
|
||
in that shell, go into `/app/data` and list all directories: | ||
|
||
```sh | ||
cd /app/data | ||
ls | ||
``` | ||
|
||
you should see the three directories `index`, `resource` and `transaction`. | ||
|
||
If you have enough disk space, just rename the index directory into `index-old`. If not, delete it assuming you have a | ||
backup! | ||
|
||
Exit the shell und start Blaze normally. | ||
|
||
## Index Store Migration at Start | ||
|
||
If you start Blaze without an index store, it will use the transaction log and the resource store to recreate the index | ||
store. During that process Blaze will not be available for reads and writes. Reading from Blaze will result in | ||
a `503 Service Unavailable` with the following `OperationOutcome`: | ||
|
||
```json | ||
{ | ||
"resourceType": "OperationOutcome", | ||
"issue": [ | ||
{ | ||
"severity": "error", | ||
"code": "timeout", | ||
"diagnostics": "Timeout while trying to acquire the latest known database state. At least one known transaction hasn't been completed yet. Please try to lower the transaction load or increase the timeout of 10000 ms by setting DB_SYNC_TIMEOUT to a higher value if you see this often." | ||
} | ||
] | ||
} | ||
``` | ||
|
||
The time needed for the rebuild of the index store is roughly the time all transactions ever happened in this instance of Blaze took. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns blaze.db.node.version | ||
(:refer-clojure :exclude [key]) | ||
(:require | ||
[blaze.byte-buffer :as bb]) | ||
(:import | ||
[java.nio.charset StandardCharsets])) | ||
|
||
|
||
(set! *warn-on-reflection* true) | ||
|
||
|
||
(def key | ||
(.getBytes "version" StandardCharsets/ISO_8859_1)) | ||
|
||
|
||
(defn encode-value [version] | ||
(-> (bb/allocate Integer/BYTES) | ||
(bb/put-int! version) | ||
(bb/array))) | ||
|
||
|
||
(defn decode-value [bytes] | ||
(bb/get-int! (bb/wrap bytes))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.