Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Cloud by
retagged by

Can I safely call import-cloud in two separate threads using the same destination system given the destination :db-names are different? For example,

;; thread 1
(dev-local/import-cloud
  {:source {:endpoint    "http://entry....",
            :server-type :ion
            :region      "us-west-2"
            :system      "db-prod"
            :proxy-port  8182
            :db-name     "db-prod"}
   :dest   {:system      "prod"
            :server-type :dev-local
            :db-name     "db-prod"}})

;; thread2 

(dev-local/import-cloud
  {:source {:endpoint    "http://entry....",
            :server-type :ion
            :region      "us-west-2"
            :system      "db-prod"
            :proxy-port  8182
            :db-name     "db-prod2"}
   :dest   {:system      "prod"
            :server-type :dev-local
            :db-name     "db-prod2"}})

1 Answer

0 votes
by

It is ok to call import to different :db-name(s). That is safe with different destinations. However, if you called import-cloud on the same :db-name that is not currently safe and could create an issue with the local DB. We are currently looking at the latter issue.

by
I am importing DBs using a function like this.

    (defn import-repro
      [system db-names]
      (doall
        (pmap
          (fn [db-name]
            (dev-local/import-cloud
              {:source (assoc source-clientm :db-name db-name)
               :dest   {:system      system
                        :server-type :dev-local
                        :db-name     db-name}}))
          db-names)))

When I call it, I will get an exception.

(import-repro "prod" (distinct db-names))
Exception link: https://pastebin.com/qpYE0hHN

That's when importing to a system that already exists. When I try calling the same function with a system name that does not exist, I get a different exception.

(import-repro "prod" (distinct db-names))
Exception link: https://pastebin.com/8zdEjhfB

After I got that exception, I stopped my REPL and started a new one. I called the function again with the same args and received a different exception.

(import-repro"prod2" (distinct db-names))
Exception link: https://pastebin.com/KZqzk2ph
Welcome to the Datomic Knowledgebase, where you can make features requests, ask questions and receive answers from other members of the community.
...