jepsen-io / jepsen

A framework for distributed systems verification, with fault injection
6.69k stars 710 forks source link

Mismatch of no. of parameters in postgresql test #467

Closed winddd closed 4 years ago

winddd commented 4 years ago

In jepsen.stolon.append, it calls await-open with 2 parameters while in jepsen.stolon.client, the function is defined to accept only one parameter.

The codes are attached here:

(do (when (zero? tries)
                  (throw e))
                (info "Retrying IO error")
                (Thread/sleep 1000)
                (c/close! conn)
                (retry (c/await-open test node)
                       (dec tries)))
(defn await-open
  "Waits for a connection to node to become available, returning conn. Helpful
  for starting up."
  [node]
  (with-retry [tries 100]
    (info "Waiting for" node "to come online...")
    (let [conn (open node)]
      (try (j/execute-one! conn
                           ["create table if not exists jepsen_await ()"])
           conn
           (catch org.postgresql.util.PSQLException e
             (condp re-find (.getMessage e)
               ; Ah, good, someone else already created the table
               #"duplicate key value violates unique constraint \"pg_type_typname_nsp_index\""
               conn

               (throw e)))))
    (catch org.postgresql.util.PSQLException e
      (when (zero? tries)
        (throw e))

      (Thread/sleep 5000)
      (condp re-find (.getMessage e)
        #"connection attempt failed"
        (retry (dec tries))

        #"Connection to .+ refused"
        (retry (dec tries))

        #"An I/O error occurred"
        (retry (dec tries))

        (throw e)))))

The open function has the similar issue when I am trying to run the postgresql test.

aphyr commented 4 years ago

Ah, whoops, that must have made it through my tests because the old arity was cached in the compiled namespace. Fixed!

winddd commented 4 years ago

It seems the codes haven't been updated yet. Will it be left in the next commit?

Ah, whoops, that must have made it through my tests because the old arity was cached in the compiled namespace. Fixed!

aphyr commented 4 years ago

It's in origin now.

winddd commented 4 years ago

Similar case still exists in db.clj and ledger.clj.