This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-07
Channels
- # architecture (35)
- # babashka (9)
- # beginners (31)
- # biff (15)
- # calva (8)
- # catalyst (3)
- # cider (7)
- # clerk (4)
- # clj-kondo (24)
- # clj-yaml (10)
- # clojure (58)
- # clojure-europe (65)
- # clojure-japan (1)
- # clojure-nl (1)
- # clojure-norway (89)
- # clojure-spec (1)
- # clojure-sweden (1)
- # clojure-uk (8)
- # clojurescript (14)
- # cursive (3)
- # datahike (1)
- # datomic (29)
- # emacs (8)
- # graalvm (20)
- # graphql (1)
- # gratitude (2)
- # helix (6)
- # hyperfiddle (65)
- # jobs-discuss (7)
- # leiningen (1)
- # lsp (6)
- # malli (14)
- # missionary (12)
- # nrepl (8)
- # off-topic (24)
- # polylith (29)
- # reagent (14)
- # sci (14)
- # shadow-cljs (6)
- # spacemacs (10)
- # sql (4)
I just stepped upon the following bug: https://forum.datomic.com/t/troubles-with-upsert-on-composite-tuples/1355/7. 1. I’m trying to understand whether manually inserting the composite tuples to trigger upsert is okay? 2. Is automatic ref resolving and automatic upsert in composite tuples in the Datomic team roadmap or status is „won’t fix”?
We have an open story to review ref resolution in tuples, but for now you should resolve refs to achieve upsert behavior.
Thank you for the answer! I will resolve refs manually then 🙂
Seeing really strange message for Datomic 1.0.6735. What is the reason datomic transactor tries to connect to some AWS internal url? I need healthchecks to achieve zero downtime deployments for dokku deployment on Hetzner.
java.lang.RuntimeException: Unable to start ping endpoint localhost:9999
at datomic.transactor_ext$start_ping_endpoint.invokeStatic(transactor_ext.clj:58)
at datomic.transactor_ext$start_ping_endpoint.invoke(transactor_ext.clj:39)
at datomic.transactor$run_STAR_.invokeStatic(transactor.clj:334)
at datomic.transactor$run_STAR_.invoke(transactor.clj:246)
at datomic.transactor$run$fn__25113.invoke(transactor.clj:388)
at clojure.core$binding_conveyor_fn$fn__5823.invoke(core.clj:2047)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.FileNotFoundException:
I have not tried running Datomic on Hetzner, but that error is caused by the AWS CLI I think being unable to find other nodes. On Hetzner what is your underlying storage? What does your transactor properties file look like?
I get the same error. I am using Hetzner and Datomic 1.0.6735. It only happens if I specify an healtcheck endpoint in the transactor properties file. @karol.wojcik Where you able to solve this issue?
On a Hetzner node this works: curl
,(withouth the “placement” path segment), but I have no idea, why this is called and how I could configure it.
I didn’t figure it out unfortunately.
@U023LKF2PQV do you have some more info you can pass to @U1QJACBUM in this 🧵. I’m not actively working on my hobby project anymore.
Yeah, if I can get some more information specifically transactor properties file, underlying storage etc. I am happy to try to setup Hetzner and explore if we need to do something to support working their
I am using postgres backend. My dockerfile is straightforward. Download the transactor. Adjust the properties file with sed command. Create datomic_kv table if it does not exist and run the transactor. This is the transactor file:
protocol=sql
host=resolvable.transactor.hostname
port=4334
sql-url=jdbc:
sql-user=postgres
sql-password=mysecretpassword
sql-driver-class=org.postgresql.Driver
memory-index-threshold=32m
memory-index-max=256m
object-cache-max=128m
ping-concurrency=6
I start the transactor with bin/transactor -Ddatomic.pingHost=localhost -Ddatomic.pingPort=9999 -Ddatomic.printConnectionInfo=true config/transactor.properties
I run it on a CAX11 arm vcpu in a k3s based k8 cluster.
Running the transactor without the healtcheck endpoint bin/transactor config/transactor.properties
on Hetzner works. Running it with the healtcheck endpoint on Hetzner results in the error that Karol posted. Running the dockerfile locally on my mac with docker and healthcheck endpoint works.
I sshed into one of the Hetzner nodes and ran :
curl
That failed. Then I tried :
curl
That worked. The former url is AWS specific, the latter Hetzner specific. But I do not know, why the transactor sends a request to the endpoint in the first place. I do not see the point, why this information is needed to spin up a little endpoint that returns 200 ok.@U1QJACBUM I have exactly the same config. Is this info provided by Henrik sufficient for you to reproduce?
Yes @karol.wojcik I am hoping to get to this later this week, but I am working through a Pro Release and a Datomic Local release QA process first.
Thank you so much!
@U1QJACBUM hey 👋 , sorry for pinging you directly but do you have some additional info about this issue?
@karol.wojcik are you sure you are on a version > 1.0.6735 on both peer and transactor? I suspect this issue is related to our regression, noted here: https://docs.datomic.com/pro/changes.html#1.0.6735. Ideally, I would like to know if you can reproduce on the latest version of Datomic Pro 1.0.7075. Would it be possible for you to upgrade peers and transactors to that version and retest health check?
My next intuition is that healthcheck is not starting on these machines and I would need more detail on the specific machines used (cores, etc). Or the port is not actually open on the machines.
Thank you so much. Upgrading to 1.0.7075 and checking if the port is open. Will post my findings soon ;)
Hi, is it possible to search using partial tuples?, say that I have a tuple with three elements and I only know 2 of them and I would like to do something like this:
(d/q {:query '{:find [(count ?n)]
:in [$]
:where [[?a :note-attribute/name+value+type ["tenant-id" "7777777" _]]
[?n :system-note/attributes ?a]]}
:args [db]})
Or, is the only way to have another tuple but with two elements?
*Notice that I put an underscore for the unknown value.Sorry I have time to expand on this now. You can do something like this
'{:find [(count ?n)]
:in [$]
;; nil sorts before any other value, so you can use this as a start position
:where [[(ground ["tenant-id" "7777777" nil]) ?start]
;; It's making the "end of range" value that is hard
;; and will depend on your data structure.
;; <= Long/MAX_LONG works well for numbers,
;; but I don't know what "type" is.
[(ground ["tenant-id" "7777778" nil]) ?end]
[?a :note-attribute/name+value+type ?value]
[(<= ?start ?value)]
[(< ?value ?end)]
[?n :system-note/attributes ?a]]}
🤯
Thank you!
I was trying to do something else without the ground
function
it was not working btw
ground isn’t strictly necessary, you can supply ?start and ?end as inputs, or destructure from something else
It’s the [?x :attr ?v][(<= ?start ?v)][(< ?v ?end)]
pattern that is essential for performance
kk, it worked pretty fast, even without an specific end,
I’m doing a search like count all the notes that have attributes with name "tenant-id" and value "7777777"
so the start is the only thing I needed to establish,
Yes @karol.wojcik I am hoping to get to this later this week, but I am working through a Pro Release and a Datomic Local release QA process first.