Fork me on GitHub
#datomic
<
2023-05-06
>
camdez16:05:03

I’ve been struggling to upgrade my AWS-hosted Datomic On-Prem to 1.0.6726; transactor is failing to launch. After a great deal of AWS fuckery to even get access to the error, I’m seeing this:

Launching with Java options -server -Xms2625m -Xmx2625m -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Execution error (UnsupportedClassVersionError) at java.lang.ClassLoader/defineClass1 (ClassLoader.java:-2).
datomic/impl/Exceptions$IllegalArgumentExceptionInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
It seems that the AMI must be running Java 8 but Datomic wants Java 11. I don’t believe there’s any way I could have caused this because I’m running a CloudFormation template produced by bin/datomic create-cf-template, which embeds the AMI decision. AMI is ami-cca215b4. Anything I could have done wrong here, or are the official AMIs possibly borked and contain an unsupported version of Java?

camdez16:05:55

Seems possible the AMIs are broken since the requirement for Java 11 only came with 1.0.6711 on 4/20.

jaret23:05:36

I see. We will have to update that and provide another ami. However The cft template was provided as a dev convenience, you can create your own ami and plug it into that template or roll your own template now. Cheers!

camdez13:05:55

Thanks, @U1QJACBUM. Any rough estimate on what the timeline for a new AMI from your side would look like? Anything special about the AMI that I should know if I need to roll my own? It’s more or less a black box to me since I can’t seem to SSH in or use Instance Connect. I appreciate your help.

jaret13:05:14

Sorry no estimate at this time we are focusing on freeing Cloud from marketplace this next week and in terms of Ami it wont be particularly special, just baked with the latest version and Java 11. Caveat being that I haven’t started the work yet to figure out if that assessment is correct.

👍 4
jaret13:05:23

To SSH there is a property in the template you would have to set and relaunch to allow external access. I don’t have it in front of me.

camdez13:05:13

Thanks. That’s enough to get me moving! If it’s helpful, I can confirm exactly which version of Java is running in that AMI. I imagine it should be pretty easy for you to confirm that the AMI id I shared is, in fact, the one put in by the bin/datomic command from 1.0.6726 and then I think it would confirm the assessment.

camdez13:05:48

Huh, I have not noticed such a parameter. Curious.

camdez13:05:33

Anyway, I want to be respectful of your priorities. Let me know if I can be helpful.

camdez14:05:13

FWIW, java -version reports the following on ami-cca215b4 :

openjdk version "1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-b08)
OpenJDK 64-Bit Server VM (build 25.362-b08, mixed mode)

camdez14:05:41

@U1QJACBUM Thanks again for the response, and I hope you have a great Sunday.

Eduardo Lopes18:05:15

I'm new to datomic and working with an datomic + SQL storage service at my work, talking with @souenzzo he explained me some differences of using Dynamo. This made me think what are the pros and cons of each storage service, does anyone seen a blog post or some discussion about this? I'm trying to improve this legacy application I maintain and I don't know if there are any benefits changing from SQL to another storage service, maybe something like lower response time, less resources consumption, ease to maintain or debug. I would like to hear some experiences of other storage services and if its worth it.

jaret12:05:00

@U04P8PN0LCS if you end up creating such a document I'd be happy to review and add to it! Datomic uses all underlying storage similarly, as a Key Value store. Datomic does not store individual datoms in storage it stores many datoms in segments that are keyed with a UUID. I usually recommend that customers use the storage they are most comfortable with. Our Enterprise customer base tends to be mostly DDB/SQL followed by Cassandra users. The differences in those deployments usually comes down to operational things like Cass multi-node replication or provisioning read and writes on DDB. And not in anything particular to Datomic's usage of the storage. The comparisons of Cass/SQL/DDB that already exist would be applicable to determining the differences of running Datomic on each. I would be happy to talk in more detail.

Eduardo Lopes12:05:59

Thank you! I’ll go after it, I was “debugging” the SQL and saw the UUIDs and the first thing I thought is that dynamo may be faster because of constant time lookup than an SQL that is logarithmic, assuming it uses index. And then I thought it may exists some little details that change perfomance in a system that is heavy used. As soon as I do some tests and write something I will come back here :) thanks a lot

jherrlin19:05:15

Hey, I have and old project running datomic-free-0.9.5703.21 on a server. The data lives in a datomic.h2.db file. Is it possible to use that with the latest version of Datomic Pro?

jaret23:05:20

Sure! But it depends on how you plan to move the data. You can use backup and restore to backup your free db then move it to ‘dev’ or the storage protocol of your choice. Or you can transact over to a new db. I recommend using backup and restore.

jherrlin07:05:57

Backup and restore sounds like the way to go for me. Thanks!

jherrlin19:05:37

Backup and restored worked fine. It took me some time to figure out that I needed to specify the protocol. Add the commands here in case someone else has the same problem.

bin/datomic backup-db datomic: file:backups
bin/datomic restore-db file:backups datomic:

Drew Verlee23:05:51

How would i retrieve the last ten transactions? d/history? The part I think i'm not sure is how to express the filtering, which I want to do based on time. Time because i'm trying to learn what transactions my browser client is producing given a server request. Here is what i have

(map #(d/pull (./db) '[*] %)
       (let [time (-> (java.util.Date.) (.getTime) (- (* 10 60 1000)))]
         (d/q '[:find [?tx ...]
                :in $ ?time
                :where [?tx :db/txInstant ?instant]
                [(> ?instant ?time)]]
              (d/history (./db)) time)))

Drew Verlee02:05:22

Is this closer? It seems so but I need to check it.

(d/q '[:find ?aname ?v
         :where
         [?e ?a ?v ?tx true]
         [?a :db/ident ?aname]]
       (d/history (d/since (./db)
                           ;; ten minutes ago
                           (-> (java.util.Date.) (.getTime) (- (* 10 60 1000))))))

favila13:05:46

You don’t need a history db

favila13:05:55

If you want the transactions themselves, look up values in :db/txInstant using d/index-range or seek-datoms avet or index-pull

favila13:05:36

If you want the datoms in those transactions too, use tx-log and tx-range

👍 4