pg_eventstore 3.0.0 → 3.0.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/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/docs/configuration.md +29 -0
- data/docs/how_it_works.md +0 -25
- data/lib/pg_eventstore/middleware/event_tracing.rb +1 -1
- data/lib/pg_eventstore/version.rb +1 -1
- 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: 24899ca6d10bac21341f41f3a8cfee09e10ce10bf81fb4525e9660f6c708d3af
|
|
4
|
+
data.tar.gz: 07cbbca86a3cb488d9123d663e77cb66cdbf850f93e12f1f15e46dc8f465879c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc33cc4bcdda545ffa4476e80b55ca2541de4da036d715644f3957d1889170bbdf3b05b1391c7f981f28163da0ce36d06b0a8282ddeddb7560eb1892df43cfaa
|
|
7
|
+
data.tar.gz: 64b63413791d2c993315d4012acb1a5bec19b237eae6761c6b9da8725483e4284f5fbf3b956df5c4a750719460087f30cec6c9db1f176ce728ad985f2aefa213
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Implements database and API to store and read events in event sourced systems.
|
|
|
12
12
|
|
|
13
13
|
### Migrating to v3
|
|
14
14
|
|
|
15
|
+
v3 introduces several new tables to support the functional. Make sure you have enough disk space on your PostgreSQL host.
|
|
16
|
+
|
|
15
17
|
If you are migrating from v2 - please don't forget to delete cron jobs and `pg_cron` extension after migration to v3.
|
|
16
18
|
You can remove cron jobs as follows:
|
|
17
19
|
|
data/docs/configuration.md
CHANGED
|
@@ -154,3 +154,32 @@ split your replica subscriptions from your application subscriptions and adjust
|
|
|
154
154
|
Please note, that this is an **upper limit** of events to replicate at a time. Subscriptions have their own measurement
|
|
155
155
|
of how many events a subscription handler processes per second. Thus, the number of events actually processed by a
|
|
156
156
|
subscription at a time may differ.
|
|
157
|
+
|
|
158
|
+
## PostgreSQL settings
|
|
159
|
+
|
|
160
|
+
If you are running PostgreSQL from docker - make sure you adjust `shm_size` docker setting from its default (`/dev/shm`
|
|
161
|
+
size; responsible for the shared memory size; default is `64M`) so that parallel PostgreSQL workers have enough
|
|
162
|
+
resources.
|
|
163
|
+
|
|
164
|
+
The more partitions you have, the more locks are required for operations that affect multiple partitions. It mainly
|
|
165
|
+
concerns the case when you involve many different event types when using `Client#multiple`. It may lead to the next
|
|
166
|
+
error:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
ERROR: out of shared memory (PG::OutOfMemory)
|
|
170
|
+
HINT: You might need to increase max_pred_locks_per_transaction.
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
PostgreSQL suggests to increase the `max_pred_locks_per_transaction`(the description of it
|
|
174
|
+
is [here](https://www.postgresql.org/docs/current/runtime-config-locks.html)). The default value is `64`. In case you
|
|
175
|
+
have several thousands of partitions - you may want to set it to `128` or even to `256`.
|
|
176
|
+
|
|
177
|
+
You may also face similar error which refers to `max_locks_per_transaction` setting:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
PG::OutOfMemory: ERROR: out of shared memory (PG::OutOfMemory)
|
|
181
|
+
HINT: You might need to increase "max_locks_per_transaction".
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The reason of it to appear is the same - too many objects(partition tables, indexes, etc) are involved in a single
|
|
185
|
+
transaction.
|
data/docs/how_it_works.md
CHANGED
|
@@ -51,31 +51,6 @@ end.to_a
|
|
|
51
51
|
# {"id"=>3, "context"=>"SomeCtx", "stream_name"=>"SomeStream", "event_type"=>"SomethingChanged", "table_name"=>"event_types_aeadd5"}]
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
### PostgreSQL settings
|
|
55
|
-
|
|
56
|
-
The more partitions you have, the more locks are required for operations that affect multiple partitions. It mainly
|
|
57
|
-
concerns the case when you involve many different event types when using `Client#multiple`. It may lead to the next
|
|
58
|
-
error:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
ERROR: out of shared memory (PG::OutOfMemory)
|
|
62
|
-
HINT: You might need to increase max_pred_locks_per_transaction.
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
PostgreSQL suggests to increase the `max_pred_locks_per_transaction`(the description of it
|
|
66
|
-
is [here](https://www.postgresql.org/docs/current/runtime-config-locks.html)). The default value is `64`. In case you
|
|
67
|
-
have several thousands of partitions - you may want to set it to `128` or even to `256`.
|
|
68
|
-
|
|
69
|
-
You may also face similar error which refers to `max_locks_per_transaction` setting:
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
PG::OutOfMemory: ERROR: out of shared memory (PG::OutOfMemory)
|
|
73
|
-
HINT: You might need to increase "max_locks_per_transaction".
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The reason of it to appear is the same - too many objects(partition tables, indexes, etc) are involved in a single
|
|
77
|
-
transaction.
|
|
78
|
-
|
|
79
54
|
## Appending events and multiple commands
|
|
80
55
|
|
|
81
56
|
You may want to get familiar with [Appending events](appending_events.md) and [multiple commands](multiple_commands.md)
|
|
@@ -31,7 +31,7 @@ module PgEventstore
|
|
|
31
31
|
event.feature_markers.push(self.class.causation_marker(event.causation_id))
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
event.correlation_id = event.caused_by&.correlation_id&.dup || SecureRandom.uuid_v7
|
|
34
|
+
event.correlation_id = event.caused_by&.correlation_id&.dup || event.correlation_id || SecureRandom.uuid_v7
|
|
35
35
|
event.metadata[CORRELATION_ID_KEY] = event.correlation_id
|
|
36
36
|
event.feature_markers.push(self.class.correlation_marker(event.correlation_id))
|
|
37
37
|
end
|