xtdb

benny 2024-11-04T10:37:03.789319Z

I can't seem to find the source file for https://docs.xtdb.com/static/learn-xtql-today-with-clojure.html, because I wanted to work through it and update the docs because xt/put doesn't exist any more

refset 2024-11-04T14:25:06.727379Z

Hey @b thanks for taking a look and mentioning it, and sorry to cause confusion by not fixing this ourselves already! The source is https://github.com/xtdb/2x-playground/blob/main/clojure/src/learn-xtql-today-with-clojure.clj and the issue was already reported https://github.com/xtdb/2x-playground/issues/3 ...so I'll fix this today unless you beat me to it πŸ™‚

benny 2024-11-04T14:50:30.266509Z

No worries. I copy pasted the notebook stuff and could work through it anyway and the :put-docs was in the docs, so I wasn't stuck. I tried my hand to update the deps now, but there are also juxt vendored clojars mirror stuff and that rises above the current "want to investigate further"-threshold. That's probably way quicker if you do it. Thanks! πŸ™‚

πŸ™ 1
genekim 2024-11-04T21:20:43.830869Z

Purely FYI: here’s my update to the save-checkpoint! command that @taylor.jeremydavid had written that makes explicit all the namespaced keywords, so that it can be in any namespace. My use case is a command-line utility that runs regularly (daily), where I want it to save a checkpoint before it exits. (Actually, the real use case is that it took so many iterations to get right, I got tired of waiting the extra 15 seconds for it to sync, I finally had fixed this. πŸ˜† ) https://github.com/xtdb/xtdb/issues/1813#issuecomment-2455704401

(defn save-checkpoint!
  [node]
  (let [dir (xio/create-tmpdir "checkpointing")
        src (:kv-store (:index-store node))
        store (checkpoint/->filesystem-checkpoint-store {:path (.toPath (io/file CHECKPOINTDIR))})]
        ;store (checkpoint/->filesystem-checkpoint-store {:path (.toPath (io/file devdir "cp-store"))})]
    (try
      (when-let [{:keys [tx]} (checkpoint/save-checkpoint src dir)]
        (when tx
          (log/infof "Uploading checkpoint at '%s'" tx)
          (doto (checkpoint/upload-checkpoint store dir
                  ;; NOTE: format version will be "7" for 1.22 RC and above
                  {:tx tx, :xtdb.checkpoint/cp-format
                   {:index-version xtdb.codec/index-version,
                    :xtdb.rocksdb/version "7"}
                   :cp-at (java.util.Date.)})
            (->> pr-str (log/info "Uploaded checkpoint:")))))
      (finally
        (xio/delete-dir dir)))))     

refset 2024-11-04T21:29:30.642069Z

Hey @genekim thanks for sharing πŸ™‚ Hope we can catch up soon!