Fork me on GitHub
#datomic
<
2021-05-16
>
joshkh21:05:45

maybe someone can help me solve a mystery. i'm replaying my transaction log into a new database and ran into a snag at this datom, which is adding a fact about a reference to entity 69269232556469022. the weird thing is that 69269232556469022 hasn't appeared in the transaction log up until now

(seq (d/tx-range conn {:start 64289 :end 64290}))
=>
({:t    64289,
  :data [...
         #datom[67580382696205085 715 69269232556469022 13194139597601 true]
         ...]})
and when i query its history it seems to have never existed
(d/q '{:find  [?mystery ?a ?v]
       :in    [$ ?mystery]
       :where [[?mystery ?a ?v]]}
     (d/history (d/db conn))
     69269232556469022) 
=> []
attribute 715 is a standard reference with history enabled by default (though i don't think that would make a difference here, since it's the entity itself that seems to be missing) any idea what's going on?

Joe Lane22:05:05

What is attr 715?

joshkh09:05:43

i've changed the ident name of the attribute below, but other than that it looks like this

#:db{:id          715,
     :ident       :album/artist,
     :valueType   #:db{:id 20, :ident :db.type/ref},
     :cardinality #:db{:id 35, :ident :db.cardinality/one},
     :doc         "A reference to the artist of an album"}

joshkh09:05:21

i don't know if it's related but 715 in my original post would have likely been pointing to a composite tuple entity with a uniqueness constraint by identity

Joe Lane14:05:08

In the old or the new db?

joshkh14:05:16

this is all in the old db before we get to the part of replaying the tx in the new db

Joe Lane14:05:18

@U0GC1C09L Is this on dev-local, cloud, on-prem? Can you send back a report of running: 1. (d/pull (d/db conn) '[*] 69269232556469022) 2. (d/pull (d/as-of (d/db conn) 64288) '[*] 69269232556469022) 3. (d/pull (d/as-of (d/db conn) 64289) '[*] 69269232556469022) 4. (d/pull (d/as-of (d/db conn) 64290) '[*] 69269232556469022) 5. (d/pull (d/as-of (d/db conn) 64291) '[*] 69269232556469022) You can dm me or send this to support.