This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-02
Channels
- # announcements (11)
- # aws (2)
- # babashka (42)
- # beginners (26)
- # calva (17)
- # cider (1)
- # clara (2)
- # clj-kondo (44)
- # clojars (30)
- # clojure (43)
- # clojure-australia (6)
- # clojure-europe (29)
- # clojure-gamedev (4)
- # clojure-greece (1)
- # clojure-nl (4)
- # clojure-spec (4)
- # clojure-uk (6)
- # clojurescript (28)
- # cursive (16)
- # data-science (1)
- # datahike (4)
- # datomic (26)
- # emacs (6)
- # events (3)
- # fulcro (11)
- # graalvm (7)
- # holy-lambda (118)
- # java (9)
- # jobs (1)
- # leiningen (3)
- # lsp (21)
- # luminus (2)
- # malli (13)
- # membrane-term (1)
- # music (1)
- # nrepl (3)
- # off-topic (38)
- # pedestal (2)
- # polylith (39)
- # re-frame (33)
- # reagent (7)
- # releases (1)
- # remote-jobs (4)
- # rewrite-clj (28)
- # ring (21)
- # sql (2)
- # tools-deps (23)
- # vim (4)
- # xtdb (15)
the docs on S3 checkpointer (https://docs.xtdb.com/storage/1.19.0/aws-s3/#checkpoint-store) seem out of date, can't find modules with those names
Interesting, this looks a mistake in the docs (s/checkpoint/cp), and instead you want :xtdb/module 'xtdb.s3.checkpoint-store/->cp-store
, see https://github.com/xtdb/xtdb/blob/e2f51ed99fc2716faa8ad254c0b18166c937b134/modules/s3/src/xtdb/s3/checkpoint.clj#L83
Hi, I encountered a problem while running with-tx
within a transaction function:
No implementation of method: :latest-completed-tx of protocol: #'crux.db/IndexStore found for class: crux.kv.index_store.KvIndexStoreTx
I'm guessing I hit this known issue: https://github.com/xtdb/xtdb/issues/1434?
Some context: I'm implementing a tx-fn that "moves forward" the state of a workflow and its related tasks (reified as an aggregate of crux documents) in response to an event. My idea was to write the tx-fn body as a recursive loop, because some events can "spawn" other consecutive events (e.g. auto-completion of Tasks), all of which should be handled atomically. During the recursion, state changes are accumulated in a vector of transactions, which I intended to use as input for computing speculative db instances at certain points in the recursion, and launch datalog queries on these to inspect for certain conditions (e.g. to check whether the recursion is done).
Of course a workaround with more "manual" inspections is possible, the speculative db inspections seemed a very elegant approach though.
Perhaps I am stretching the intended purpose of transaction functions here? What do you guys think? Any other approach worth considering?
Thanks
I'm attempting to work around this by not using a transaction function and accumulating the update transactions including tx/match
entries to ensure the rug wasn't pulled underneath us while computing the changes. Caveat: thinking aloud here, cfr rubber ;-)
> During the recursion, state changes are accumulated in a vector of transactions
I can't quite visualise how the recursion might work...but is there no obvious way to chain the accumulation of the ops but only do the with-tx
once (repeatedly)?
Can you post an example?
The problem I encountered was that computing a speculative db within a transaction function fails, even when with-tx
is called only once:
(def workflow-driver
{:crux.db/id WORKFLOW-DRIVER-ID
:crux.db/fn '(fn [ctx params]
(let [db (crux.api/db ctx)
;; CAUSES EXCEPTION
db* (crux.api/with-tx db [[:crux.tx/put {:crux.db/id "123"
:bla/msg "Hello, world"}]])]
[[:crux.tx/put {:crux.db/id "456"
:msg "Hello again"}]]))})
Only tested on this version:
{:mvn/version "21.02-1.15.0-beta"}
I worked around the issue by:
1. not using a tx-fn (as it is quite a complicated computation, probably a bit heavy for a tx-fn)
2. doing what you suggest: accumulating the transactions in a collection and computing speculative-db on the "base" db using these.
3. using some match
transactions here and there for sanity checks
So far it's looking good :thumbsup:
Ah, I see now...yes this is definitely the same fundamental issue as you linked initially. I'm glad you figured out an acceptable workaround(!)
is there something special needed for checkpointing lucene, I got the regular LMDB index checpoints to work with S3, but the lucene doesn't seem to do anything
never mind, it seems the random time was just different, eventually the lucene checkpoint was uploaded as well