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

Using smart driver instead of postres one #101

Merged
merged 5 commits into from
Sep 14, 2023
Merged
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: 2 additions & 2 deletions yugabyte/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[clj-http "3.12.3" :exclusions [commons-logging]]
[jepsen "0.3.1"]
[jepsen "0.3.3"]
[com.yugabyte/cassaforte "3.0.0-alpha2-yb-1"]
[org.clojure/java.jdbc "0.7.12"]
[org.clojure/data.json "2.4.0"]
[org.postgresql/postgresql "42.5.1"]
[com.yugabyte/jdbc-yugabytedb "42.3.5-yb-3"]
[version-clj "2.0.2"]
[clj-wallhack "1.0.1"]]
:main yugabyte.runner
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 org.postgresql.util.PSQLException e
(catch com.yugabyte.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 'org.postgresql.util.PSQLException table-sym
~(apply catch-dne 'com.yugabyte.util.PSQLException table-sym
`(info "Creating table" ~table-sym "and retrying")
`(create-table! ~conn ~table-sym)
body)
Expand Down
8 changes: 4 additions & 4 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 "postgresql"
{:dbtype "yugabytedb"
:dbname "postgres"
:classname "org.postgresql.Driver"
:classname "com.yugabyte.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]})

org.postgresql.util.PSQLException
com.yugabyte.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 org.postgresql.util.PSQLException e#
(catch com.yugabyte.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 org.postgresql.util.PSQLException e
(catch com.yugabyte.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 'org.postgresql.util.PSQLException table-sym
~(apply catch-dne 'com.yugabyte.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 org.postgresql.util.PSQLException e
(catch com.yugabyte.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