Skip to content

Commit

Permalink
Fixed auto.clj to enable colocation and packed after 2.16 release
Browse files Browse the repository at this point in the history
  • Loading branch information
qvad committed Apr 11, 2024
1 parent d806805 commit b070066
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions yugabyte/src/yugabyte/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[yugabyte.set :as set]
[yugabyte.utils :as utils]
[yugabyte.utils :refer :all]
[version-clj.core :as v]
[yugabyte.ycql.bank]
[yugabyte.ycql.bank-improved]
[yugabyte.ycql.counter]
Expand All @@ -40,6 +41,7 @@
(:import (jepsen.client Client)))

(def version-regex #"(?<=yugabyte\-)(\d+\.\d+(\.\d+){0,2}(-b\d+)?)")
(def minimal-colocated-packed-version "2.16.4.0-b1")

(defn noop-test
"NOOP test, exists to validate setup/teardown phases"
Expand Down Expand Up @@ -313,9 +315,11 @@
(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)))
(if (v/newer-or-equal? (:version test) minimal-colocated-packed-version)
(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."
Expand Down
1 change: 0 additions & 1 deletion yugabyte/src/yugabyte/ysql/bank_improved.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
(:require [version-clj.core :as v]
[clojure.java.jdbc :as j]
[clojure.tools.logging :refer [info]]
[clojure.tools.logging :refer [debug info warn]]
[yugabyte.ysql.client :as c]))

(def table-name "accounts")
Expand Down

0 comments on commit b070066

Please sign in to comment.