Fork me on GitHub
#datomic
<
2016-04-04
>
Lambda/Sierra12:04:50

@jetzajac: There's no efficient way to determine if an arbitrary query is affected by a transaction, in the general case. As an alternative, you can annotate transactions with metadata describing the “type” of change, and use that to determine what “types” of queries might be affected.

jetzajac12:04:44

ok, that’s likely to be a solution, thanx!

mlimotte14:04:21

How should host and and alt-host be set for Transactor. I didn't find any explicit documentation on these fields, but here's my guess: 'host' is what address the transactor should listen/bind on. 'alt-host' is the address that is advertised (by putting it in datomic storage) for clients to connect to. In my case, I'm running in a docker-image in AWS EC2. So I believe I should set 'alt-host' to the public-ip of the AWS instance. And I found an example from Stu setting 'host' to be the EC2 private-ip. But this isn't working, getting "Failed to create netty connection ... connect timed out". I'm wondering if 'host' should really be the IP of the docker container, rather than the host internal IP. I also tried 'host' as 0.0.0.0, but that didn't work either.

luposlip17:04:44

@mlimotte: I personally set host to 0.0.0.0 and alt-host to the internal ip address of the host (docker-machine). If you need to connect to it from the outside, you need a different setup with the public IP. In this case your security settings for the EC2 security group is probably blocking your incoming requests on port 4334-4336. Also remember to expose the same ports in the docker config.

luposlip17:04:48

Perhaps this will help (really rudimentary, but it was enough inspiration for me to get up and running): https://github.com/enterlab/docker-aws-ecs-env

mlimotte19:04:48

@luposlip: thanks for the response. I'm using dynamodb storage, so I believe I only need 4334 exposed. This port is exposed by the docker container and is setup for ingress from our network in the EC2 security group.

mlimotte19:04:46

I discovered that I'm able to connect to the transactor from an external IP, but Datomic Console (inside the same VPC) is unable to connect ot transactor.

mlimotte19:04:06

I think using public IP for 'alt-host' is the problem. I need public-ip so I can access the transactor from outside EC2 (batch scripts). But inside VPC I probably need an internal ip.

mlimotte19:04:11

Ok, to close the loop... I got this working by specifying the AWS public-hostname (i.e. curl >) for 'alt-host' instead of public IP. The public host resolves to the public IP when used outside of EC2, and resolves to the internal IP when used inside EC2.

luposlip20:04:22

Glad to hear you made it work!

luposlip20:04:04

Nice trick with public hostname, if you need public access.

hueyp22:04:45

is there a way to lookup all the tx-data given a tx-id? e.g. I want to see all the additions / retractions given a tx-id

hueyp22:04:22

when I give a naive query with tx-id it says insufficient bindings / would cause a full scan simple_smile

hueyp22:04:44

I guess there isn’t a T___ index

Ben Kamphaus22:04:30

In particular, "The tx-data function returns the datoms associated with a particular t or tx."

hueyp22:04:01

thanks, just found that 😜 not working atm, but looking at the docs it doesn’t work on mem dbs simple_smile

Ben Kamphaus22:04:27

oh, yes, that’s correct, mem dbs aren’t durable so don’t have the log.