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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4425f2f4cffd24b06156465726034e4c8da383fed7f0576837851a65390068e0
4
- data.tar.gz: bb809d708eaea98368d54bae14a8d35f36265a7a5ad66c4b8fd9b5dc57293163
3
+ metadata.gz: 24899ca6d10bac21341f41f3a8cfee09e10ce10bf81fb4525e9660f6c708d3af
4
+ data.tar.gz: 07cbbca86a3cb488d9123d663e77cb66cdbf850f93e12f1f15e46dc8f465879c
5
5
  SHA512:
6
- metadata.gz: e86a98610d16b95eeb4bffa5a3b0d74055ac7901a30f20d297aee1b37786e06f94ff483c135f99df255cd23f50b3cac4d9360c6338ccbdab7d58d14b05fc5578
7
- data.tar.gz: cdfe9c6093814265d91905f1405ff39bbd347a4e844c75961f3b3db56eb0fb4f32537b4cd26a0bb7c46b82abb21d25cb2aa7831623466cd3e2a3d5d50caf4a42
6
+ metadata.gz: bc33cc4bcdda545ffa4476e80b55ca2541de4da036d715644f3957d1889170bbdf3b05b1391c7f981f28163da0ce36d06b0a8282ddeddb7560eb1892df43cfaa
7
+ data.tar.gz: 64b63413791d2c993315d4012acb1a5bec19b237eae6761c6b9da8725483e4284f5fbf3b956df5c4a750719460087f30cec6c9db1f176ce728ad985f2aefa213
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [3.0.1]
4
+
5
+ - Fix EventTracing bug: Respect user-supplied Event#correlation_id value when caused_by#correlation_id is absent
6
+
3
7
  ## [3.0.0]
4
8
 
5
9
  - New feature: pg_eventstore replication
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
 
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PgEventstore
4
4
  # @return [String]
5
- VERSION = '3.0.0'
5
+ VERSION = '3.0.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_eventstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Dzyzenko