Skip to content

Commit

Permalink
Enforce exactly-once upsert writes using table primary key (#45)
Browse files Browse the repository at this point in the history
* Enforce upsert semantics using pk

* Bump release version
  • Loading branch information
teddyphreak authored Jul 4, 2023
1 parent b0f9213 commit 8adce47
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
12 changes: 5 additions & 7 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ function debug {
make kubectl get pod -- -A | grep -i metabase-app-setup | awk '{ print $2 }' | xargs -I{} make kubectl logs pod/{} -- -n dataplane
}

trap debug EXIT

make template &&
make molecule destroy &&
make molecule create &&
make images &&
make molecule converge &&
make wait &&
make molecule verify &&
make molecule side-effect &&
make molecule verify &&
trap - EXIT
make wait

trap debug EXIT
make molecule verify
trap - EXIT
4 changes: 2 additions & 2 deletions charts/dataplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.16
version: 0.1.17

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 0.1.16
appVersion: 0.1.17
4 changes: 4 additions & 0 deletions charts/dataplane/templates/strimzi/connector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ spec:
database.dbname: "{{ $db.dbname }}"
database.server.name: "{{ $dbId }}"
snapshot.new.tables: parallel
snapshot.mode: {{ $db.snapshot_mode | default "initial" }}
slot.name: "{{ $dbSlotName }}"
plugin.name: pgoutput
tasks.max: "1"
Expand Down Expand Up @@ -109,6 +110,7 @@ spec:
database.dbname: "{{ $db.dbname }}"
database.server.name: "{{ $dbId }}-{{ $partition.sink }}"
snapshot.new.tables: parallel
snapshot.mode: {{ $db.snapshot_mode | default "initial" }}
slot.name: {{ $partitionSlotName }}
plugin.name: pgoutput
tasks.max: "1"
Expand Down Expand Up @@ -147,6 +149,8 @@ spec:
tasks.max: "1"
topics.regex: "cdc.(.*)"
auto.create: true
pk.mode: "record_key"
pk.fields: ""
key.converter: io.confluent.connect.avro.AvroConverter
key.converter.schema.registry.url: http://{{ $registryName }}:{{ $registryPort }}
value.converter: io.confluent.connect.avro.AvroConverter
Expand Down
6 changes: 3 additions & 3 deletions charts/dataplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ util:
image:
repository: nephelaiio/dataplane-util
pullPolicy: IfNotPresent
tag: dataplane-0.1.16
tag: dataplane-0.1.17
resources: {}

cdc:
Expand Down Expand Up @@ -45,7 +45,7 @@ strimzi:
connect:
image:
repository: nephelaiio/dataplane-connect
tag: dataplane-0.1.16
tag: dataplane-0.1.17
replicas: 1
config:
group.id: connect-cluster
Expand Down Expand Up @@ -100,7 +100,7 @@ metabase:
image:
repository: nephelaiio/dataplane-util
pullPolicy: IfNotPresent
tag: dataplane-0.1.16
tag: dataplane-0.1.17
securityContext: {}

image:
Expand Down
3 changes: 2 additions & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ provisioner:
dataplane_chart: dataplane
dataplane_path: ${MOLECULE_PROJECT_DIRECTORY}
dataplane_metabase_hostname: "metabase.{{ k8s_cluster_name }}"
dataplane_pagila_connector_name: pagila-connector
dataplane_chart_values:
util:
image:
Expand All @@ -91,7 +92,7 @@ provisioner:
- hostname: "{{ dataplane_pagila_team }}-{{ dataplane_pagila_db }}"
port: 5432
id: pagila
connector: pagila-connector
connector: "{{ dataplane_pagila_connector_name }}"
dbname: "{{ dataplane_pagila_db }}"
signaling: "{{ dataplane_pagila_signaling }}"
exclude:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dataplane"
version = "0.1.16"
version = "0.1.17"
description = ""
authors = ["Teodoro Cook <[email protected]>"]

Expand Down

0 comments on commit 8adce47

Please sign in to comment.