You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,8 @@ As primary key and row filter for the logical replication, we use the criteria `
8
8
9
9
## Important files
10
10
11
-
-[sql/pgbench_init_pub.sql](./sql/pgbench_init_pub.sql), [sql/pgbench_init_sub.sql](./sql/pgbench_init_sub.sql): Init pgbench tables `pgbench_branches`, `pgbench_tellers`, and `pgbench_accounts` with entries where the primary keys follow the even/odd pattern for the source and the target. Additionally extend the primary keys in the tables `pgbench_accounts` and `pgbench_tellers` to contain `bid` as well. _The scale factor of 50 is applied as static value in these files and needs to be adjusted if the environment variable `PGBENCH_SCALE` is modified._
11
+
-[sql/pgbench_alter.sql](./sql/pgbench_alter.sql): Extend the primary keys in the tables `pgbench_accounts` and `pgbench_tellers` to contain `bid` as well.
12
+
-[sql/pgbench_init_pub.sql](./sql/pgbench_init_pub.sql), [sql/pgbench_init_sub.sql](./sql/pgbench_init_sub.sql): Init pgbench tables `pgbench_branches`, `pgbench_tellers`, and `pgbench_accounts` with entries where the primary keys follow the even/odd pattern for the source and the target. _The scale factor of 50 is applied as static value in these files and needs to be adjusted if the environment variable `PGBENCH_SCALE` is modified._
12
13
-[sql/repl_pub.sql](./sql/repl_pub.sql): Create publication for all pgbench tables using the row filter criteria `bid = 1` on the source.
13
14
-[sql/repl_sub.sql](./sql/repl_sub.sql): Create subscription for the publication in the target.
14
15
-[bench/pub.bench](./bench/pub.bench), [bench/sub.bench](./bench/sub.bench): Benchmark scripts to use with modified identifiers following the even/odd pattern for the source and the target.
@@ -349,7 +350,7 @@ Configuration Settings
349
350
First prepare tables and generate traffic.
350
351
351
352
```shell
352
-
make preapre -j 2
353
+
make prepare -j 2
353
354
make run -j 2
354
355
```
355
356
@@ -407,7 +408,30 @@ The final `make validate` shows that the data is still consistent afterwards.
407
408
408
409
### Violation of constraints
409
410
410
-
_tbw._
411
+
- Create pgbench schema
412
+
- Insert conflicting entry in target
413
+
- Create pgbench base data
414
+
- Setup publication and subscription
415
+
416
+
```shell
417
+
make conflict
418
+
```
419
+
420
+
The logs for the target look similar to these.
421
+
422
+
```text
423
+
LOG: logical replication table synchronization worker for subscription "sub_bid_1", table "pgbench_branches" has started
424
+
ERROR: duplicate key value violates unique constraint "pgbench_branches_pkey"
0 commit comments