Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Implemented colocated and use yugabyte JDBC driver (#97)" #99

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion yugabyte/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
[com.yugabyte/cassaforte "3.0.0-alpha2-yb-1"]
[org.clojure/java.jdbc "0.7.12"]
[org.clojure/data.json "2.4.0"]
[com.yugabyte/jdbc-yugabytedb "42.3.5-yb-3"]
[org.postgresql/postgresql "42.5.1"]
[version-clj "2.0.2"]
[clj-wallhack "1.0.1"]]
:main yugabyte.runner
:jvm-opts ["-Djava.awt.headless=true"])
; :aot [yugabyte.runner
; clojure.tools.logging.impl])
9 changes: 5 additions & 4 deletions yugabyte/src/yugabyte/auto.clj
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@

(defn ysqlsh
"Runs a ysqlsh command on a node. Args are passed to ysqlsh."
[args]
[test & args]
(apply c/exec (str dir "/bin/ysqlsh")
args))


(defn list-all-masters
"Asks a node to list all the masters it knows about."
[test]
Expand Down Expand Up @@ -377,8 +378,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 @@ -521,7 +522,7 @@
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"
(ysqlsh :-c "CREATE DATABASE jepsen WITH colocated = true;")
(ysqlsh :-c "\"CREATE DATABASE jepsen WITH colocated = true;\"")
)

db/LogFiles
Expand Down
4 changes: 2 additions & 2 deletions yugabyte/src/yugabyte/ysql/append_table.clj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
[:k :timestamp :default "NOW()"]
[:v :int]]
{:conditional? true}))
(catch com.yugabyte.util.PSQLException e
(catch org.postgresql.util.PSQLException e
(when-not (re-find #"already exists" (.getMessage e))
(throw e)))))

Expand All @@ -103,7 +103,7 @@
`(info "Creating table" ~table-sym "and retrying")
`(create-table! ~conn ~table-sym)
body)
~(apply catch-dne 'com.yugabyte.util.PSQLException table-sym
~(apply catch-dne 'org.postgresql.util.PSQLException table-sym
`(info "Creating table" ~table-sym "and retrying")
`(create-table! ~conn ~table-sym)
body)
Expand Down
10 changes: 5 additions & 5 deletions yugabyte/src/yugabyte/ysql/client.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
(defn db-spec
"Assemble a JDBC connection specification for a given Jepsen node."
[node]
{:dbtype "yugabytedb"
:dbname "jepsen"
:classname "com.yugabyte.Driver"
{:dbtype "postgresql"
:dbname "postgres"
:classname "org.postgresql.Driver"
:host (name node)
:port ysql-port
:user "postgres"
Expand Down Expand Up @@ -178,7 +178,7 @@
(update op :error (partial vector :batch)))
{:type :info, :error [:batch-update m]})

com.yugabyte.util.PSQLException
org.postgresql.util.PSQLException
(condp re-find m
#"(?i)Conflicts with [- a-z]+ transaction"
{:type :fail, :error [:conflicting-transaction m]}
Expand Down Expand Up @@ -300,7 +300,7 @@
[& body]
`(util/with-retry [attempts# max-retry-attempts]
~@body
(catch com.yugabyte.util.PSQLException e#
(catch org.postgresql.util.PSQLException e#
(let [m# (.getMessage e#)]
(if (or (re-find #"duplicate key value violates unique constraint" m#)
(re-find #"A relation has an associated type of the same name" m#)
Expand Down
6 changes: 3 additions & 3 deletions yugabyte/src/yugabyte/ysql/default_value.clj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
[[:dummy :int]
[:v :int :default "0"]]
{:conditional? true}))
(catch com.yugabyte.util.PSQLException e
(catch org.postgresql.util.PSQLException e
(when-not (re-find #"already exists" (.getMessage e))
(throw e)))))

Expand Down Expand Up @@ -81,7 +81,7 @@
`(info "Creating table" ~table-sym "and retrying")
`(create-table! ~conn ~table-sym)
body)
~(apply catch-dne 'com.yugabyte.util.PSQLException table-sym
~(apply catch-dne 'org.postgresql.util.PSQLException table-sym
`(info "Creating table" ~table-sym "and retrying")
`(create-table! ~conn ~table-sym)
body)
Expand All @@ -108,7 +108,7 @@
(assoc op :type :ok))
:drop-column (do (drop-column! c table (:value op))
(assoc op :type :ok)))
(catch com.yugabyte.util.PSQLException e
(catch org.postgresql.util.PSQLException e
(if (re-find #"column .+ does not exist" (.getMessage e))
(assoc op :type :fail, :error :column-does-not-exist)
(throw e))))))
Expand Down
Loading