Skip to content

Commit

Permalink
Added packed columns random flag (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
qvad authored Nov 8, 2023
1 parent af65490 commit b25fff1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
18 changes: 13 additions & 5 deletions yugabyte/src/yugabyte/auto.clj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"Start both master and tserver. Only starts master if this node is a master
node. Waits for masters and tservers."
(info "Starting master and tserver for" (name (:api test)) "API")

(when (master-node? test node)
(start-master! db test node)
(await-masters test))
Expand Down Expand Up @@ -315,6 +316,13 @@
:--callhome_enabled=false
])

(defn master-tserver-packed-columns
[packed-columns-enabled]
(if packed-columns-enabled
[:--ysql_enable_packed_row]
[])
)

(defn master-api-opts
"API-specific options for master"
[api node]
Expand Down Expand Up @@ -378,8 +386,8 @@
geo-node-map (zipmap nodes geo-ids)
node-id-int (get geo-node-map node)]
(info node [:--placement_cloud :ybc
:--placement_region (str "jepsen-" node-id-int)
:--placement_zone (str "jepsen-" node-id-int "a")])
:--placement_region (str "jepsen-" node-id-int)
:--placement_zone (str "jepsen-" node-id-int "a")])
[:--placement_cloud :ybc
:--placement_region (str "jepsen-" node-id-int)
:--placement_zone (str "jepsen-" node-id-int "a")])
Expand Down Expand Up @@ -470,6 +478,7 @@
(master-tserver-experimental-tuning-flags test)
(master-tserver-random-clock-skew test node)
(master-tserver-wait-on-conflict-flags test)
(master-tserver-packed-columns (:yb-packed-columns-enabled test))
(master-tserver-geo-partitioning-flags test node (:nodes test))
(master-api-opts (:api test) node)
)))
Expand All @@ -490,6 +499,7 @@
(master-tserver-experimental-tuning-flags test)
(master-tserver-random-clock-skew test node)
(master-tserver-wait-on-conflict-flags test)
(master-tserver-packed-columns (:yb-packed-columns-enabled test))
(master-tserver-geo-partitioning-flags test node (:nodes test))
(tserver-api-opts (:api test) node)
(tserver-read-committed-flags test)
Expand Down Expand Up @@ -522,11 +532,9 @@
db/Primary
(setup-primary! [this test node]
"Executed once on a first node in list (i.e. n1 by default) after per-node setup is done"
(let [colocated (and (not (utils/is-test-geo-partitioned? test)) (> (rand) 0.5))
colocated-clause (if colocated
(let [colocated-clause (if (:yb-colocated test)
" WITH colocated = true"
"")]
(info "Creating JEPSEN" (if colocated "colocated" "") "database")
(ysqlsh test :-h (cn/ip node) :-c (str "CREATE DATABASE jepsen" colocated-clause ";")))
)

Expand Down
10 changes: 9 additions & 1 deletion yugabyte/src/yugabyte/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
[yugabyte.nemesis :as nemesis]
[yugabyte.single-key-acid :as single-key-acid]
[yugabyte.set :as set]
[yugabyte.utils :as utils]
[yugabyte.utils :refer :all]
[yugabyte.ycql.bank]
[yugabyte.ycql.bank-improved]
Expand Down Expand Up @@ -309,7 +310,14 @@
:pure-generators true
:checker checker})))

(defn test-3
"Final phase where we define global cluster configuration parameters"
[opts]
(let [packed-columns-enabled (> (rand) 0.5)
colocated (and (not (utils/is-test-geo-partitioned? opts)) (> (rand) 0.5))]
(assoc opts :yb-packed-columns-enabled packed-columns-enabled :yb-colocated colocated)))

(defn yb-test
"Constructs a yugabyte test from CLI options."
[opts]
(-> opts test-1 test-2))
(-> opts test-1 test-2 test-3))

0 comments on commit b25fff1

Please sign in to comment.