xtdb

Matti Uusitalo 2025-04-17T06:31:45.202399Z

I ran into a problem while trying to use the in-memory xtdb-core dependency in my app. I think it may be because I'm using the latest versions of reitit and ring, which pull a newer version of jetty than what xtdb-core is expecting? Maybe I'm missing something here. I made a minimal version of the app that demonstrates the problem https://github.com/mattiuusitalo/xtdb-problem

Matti Uusitalo 2025-04-17T06:42:16.340059Z

this is missing some of the required jvm arguments. Let me check if that fixes it

You'll also need to add the following JVM arguments to run Apache Arrow (included in the :xtdb deps.edn alias above):
--add-opens=java.base/java.nio=ALL-UNNAMED

-Dio.netty.tryReflectionSetAccessible=true

Matti Uusitalo 2025-04-17T06:46:23.727119Z

Doesn't seem like it. I added the jvm opts and it has the same problem still

refset 2025-04-17T07:19:57.887489Z

Hi, thanks for sharing the repro. You could probably try excluding Jetty (assuming you're not wanting to expose any ports) by doing something similar to this https://github.com/xtdb/xtdb/issues/4172#issuecomment-2661042404

Matti Uusitalo 2025-04-17T07:24:09.833859Z

Thanks, I will give this a shot

jarohen 2025-04-17T09:00:33.305129Z

yep. we tried to bump ours recently but there were a few breaking changes, it wasn't a straightforward bump so admittedly I moved on to the next thing πŸ™‚

βœ… 1
jarohen 2025-04-17T09:01:06.232869Z

we have a dependabot pr open for it, will add it to our board

Matti Uusitalo 2025-04-17T09:01:24.207629Z

Thanks

jarohen 2025-04-17T09:01:32.252909Z

https://github.com/xtdb/xtdb/pull/4360

βœ… 1
Piotr Roterski 2025-04-17T08:02:51.574069Z

hello πŸ‘‹ I've run into a weird issue with xtql (from ... (with... query working on docs created on the same day, but the following day the same query does not work as it worked the day before - missing the subquery result. 😳

πŸ‘€ 1
refset 2025-04-24T22:23:55.293599Z

Hi @pt.roterski I just briefly wanted to let you know that we are (I am) still planning to look into this soon. Thanks for your patience!

Piotr Roterski 2025-04-24T22:36:43.686529Z

ah, thanks, no rush, it’s not critical for me as in I can navigate around it, and I understand I dropped this just before the easter weekend. I just wanted to help in case that’s some real issue, and not just my messed up setup. btw I’m creating those docs in a missionary flow if that makes any difference but I thought it shouldn’t since I’m calling it via standard xtdb.api

πŸ™ 1
Piotr Roterski 2025-04-18T15:13:57.715769Z

thanks for trying to help! I'm able to reproduce it pretty reliably - I use my app, creating those conversation-completion pairs, the query works, I go to sleep and the next day the query doesn't work anymore for old entires but works for the ones created on the same day. It happened to me 3rd day in the row. Yesterday, I wiped the data dir clean, so now I'm able to share it https://github.com/roterski/xtdb2-from-query-issue-debug - /data is added there to the repo, it contains single conversation entity and single completion - from query joining them does not work as it works on "fresh" data.

Piotr Roterski 2025-04-18T15:15:36.192369Z

I wiped the db clean (copied it into different dir actually) because it eventually ran into memory leak errors, let me paste them below:

Piotr Roterski 2025-04-18T15:16:12.245589Z

Piotr Roterski 2025-04-18T15:16:49.274849Z

Piotr Roterski 2025-04-17T08:40:51.891819Z

just checked it with sql equivalent and it has the same issue

(defn get-conversation-with-completion-sql
  [node conversation-id]
  (xt/q node
        ["SELECT _id, last_completion_id, created_at,
            NEST_MANY(SELECT completions._id, completions.requested_at, completions.responded_at
                       FROM completions
                       WHERE completions._id = last_completion_id)
            AS last_completion
            FROM conversations
            WHERE _id = ?"
         conversation-id]))

(comment
  
  (get-conversation-with-completion-sql xtdb-node "2025-04-17_06-46_effervescent-indigo-turtle__UNMZfDQoHOc")
  ;;=> [{:xt/id "2025-04-17_06-46_effervescent-indigo-turtle__UNMZfDQoHOc",
  ;;     :last-completion-id #uuid "0bafcdc3-fa5e-49cb-a158-fab5f2bd438e",
  ;;     :created-at #xt/zoned-date-time "2025-04-17T06:46:47.469518Z[UTC]",
  ;;     :last-completion
  ;;     [{:requested-at #xt/zoned-date-time "2025-04-17T06:46:50.447Z[UTC]",
  ;;       :responded-at #xt/zoned-date-time "2025-04-17T06:46:54.644Z[UTC]",
  ;;       :xt/id #uuid "0bafcdc3-fa5e-49cb-a158-fab5f2bd438e"}]}]

  (get-conversation-with-completion-sql xtdb-node "2025-04-16_21-05_heavenly-pyramidal-wombat_DV1uZ6gqpZ_J1")
  ;;=> [{:xt/id "2025-04-16_21-05_heavenly-pyramidal-wombat_DV1uZ6gqpZ_J1",
  ;;     :last-completion-id #uuid "4e650baa-0c7c-4da8-9032-7b1e57eb91a2",
  ;;     :created-at #xt/zoned-date-time "2025-04-16T21:05:12.490378Z[UTC]"}]
  
  )

jarohen 2025-04-17T09:08:58.771089Z

hey @pt.roterski πŸ‘‹ have you got a dataset you could share here? (will try to generate one)

Piotr Roterski 2025-04-17T10:27:35.831929Z

I doubt there's anything special in the data there other then what I've posted in the snippet - two tables, with one foreign key linking two docs, the thing to reproduce is that ~1 day after creation this link stops working in this query. I can't share this entire dataset as it has a lot llm junk attached to it but I could try reproducing it on minimalized dataset when I get a chance over the weekend - in what format would you want me to share it?

jarohen 2025-04-17T10:28:45.044049Z

thanks @pt.roterski πŸ™ tbh, as you have above is good - I can paste that straight into a test case πŸ™‚

πŸ™ 1
Piotr Roterski 2025-04-17T10:47:54.950439Z

ok, let me know if you have any problems reproducing it πŸ™Œ

jarohen 2025-04-17T11:49:09.683289Z

sorry - as in, I haven't been able to repro it so far - have you got some (e.g.) submit-txs/execute-txs?

Piotr Roterski 2025-04-28T15:51:30.314269Z

small update, after updating to beta7, removing protobuf exclusion and updating clojurescript and shadow-cljs to latest versions, this querying issue no longer appears! I suspect it had something to do with :patch-docs running on separate m/blk missionary thread because I had a different problem (throwing java.lang.RuntimeException: Unrecognized date/time syntax: +294247-01-10T04:00:54.775807000-00:00 ) that happened only when I ran tests via kaocha (and not via repl) but I have replaced patch-docs with put-docs and it no longer happens. Everything works now.

πŸ™Œ 1
refset 2025-04-28T17:01:04.625049Z

Ah, brilliant, glad to hear! Thanks for letting us know :)