Fork me on GitHub
#xtdb
<
2023-02-21
>
Paul Hempel16:02:46

Hi everyone. I’m curious if it is possible to “await”/“sync” a xtdb transaction of a different (K8s) node. xt/await-tx requires a transaction which is only available in the context of the current node, maybe there is a similar function but for multi-node setup? The goal is to circumvent the need for an additional scheduling tool (quartz) and instead use xtdb to signal other nodes that the cron job is taken care of (e.g. by saving a date). It’s okay if the answer is “hell no, don’t do this”, but if it is possible I’d give it a try. :)

refset16:02:01

Hey @U02DR6Q7NL8 sync should work for exactly this in a multi-node setup, because it looks up the latest tx in the tx-log

👀 2
refset16:02:34

If you need even more consistency than that however, you may want to use something (e.g. Zookeeper) to establish a high watermark across the cluster, or in the extreme case (for maximum consistency) you could run queries that execute within transaction functions (but this will block the serialised transaction processing and consume storage, so definitely isn't free)

Paul Hempel17:02:23

Thank you, @U899JBRPF! I’ll keep the additional consistency methods in mind, but worst case is, we get two times the same Slack notification – so I’ll test the easy way first.

🙏 2
Paul Hempel17:02:32

And even more I realised that there is more documentation apart of the “language reference”-section. That will help even more in the long term 😄

🙌 2