Skip to content

Commit c9af279

Browse files
authored
set one_phase_commit and group_commit (#155)
1 parent 09dfd24 commit c9af279

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

scalardb/src/scalardb/db/cluster.clj

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,26 @@
5353
(let [path [:scalardbCluster :scalardbClusterNodeProperties]
5454
new-db-props (-> values
5555
(get-in path)
56-
(str "\nscalar.db.consensus_commit.isolation_level="
57-
(-> test
58-
:isolation-level
59-
name
60-
str/upper-case
61-
(str/replace #"-" "_"))))]
56+
(str
57+
;; isolation level
58+
"\nscalar.db.consensus_commit.isolation_level="
59+
(-> test
60+
:isolation-level
61+
name
62+
str/upper-case
63+
(str/replace #"-" "_"))
64+
;; one phase commit
65+
(when (:enable-one-phase-commit test)
66+
"\nscalar.db.consensus_commit.one_phase_commit.enabled=true")
67+
;; group commit - set hard-coded configurations for now
68+
(when (:enable-group-commit test)
69+
(str/join
70+
"\n"
71+
["\nscalar.db.consensus_commit.group_commit.enabled=true"
72+
"scalar.db.consensus_commit.coordinator.group_commit.slot_capacity=4"
73+
"scalar.db.consensus_commit.coordinator.group_commit.old_group_abort_timeout_millis=15000"
74+
"scalar.db.consensus_commit.coordinator.group_commit.delayed_slot_move_timeout_millis=400"
75+
"scalar.db.consensus_commit.coordinator.group_commit.metrics_monitor_log_enabled=true"]))))]
6276
(assoc-in values path new-db-props)))
6377

6478
(defn- install!

0 commit comments

Comments
 (0)