Fork me on GitHub
#datomic
<
2015-12-22
>
currentoor18:12:26

if I have an organization entity that has many user entities and i want to replace the set of users in an organization how should i do that?

currentoor18:12:06

i figured i should retract all the current users in the organization and then transact the new set in

currentoor18:12:26

is that the right way to go about it?

Lambda/Sierra18:12:02

If you want to do it in a single transaction, you need a transaction function that compares the old set with the new set and asserts/retracts what changed.

Lambda/Sierra18:12:24

You can't both retract and assert the same fact in a single transaction.

Lambda/Sierra18:12:21

you're welcome

currentoor18:12:34

But why can't I just query for the current set then transact the diff? Then I won't need a transaction function right?

currentoor18:12:59

Oh in case the data has changed in the mean time, right?

potetm19:12:44

So it’s a little late to the game, but I’m having a problem getting that old bug diagnostic tool running.

potetm19:12:52

I’m getting:

Exception in thread "main" com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException: Requested resource not found: Table: ${TABLE_NAME} not found (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ResourceNotFoundException; Request ID: ${REQUEST_ID})

potetm19:12:05

The command I’m running is:

bin/run -Xmx12g -m datomic.tools.detect-865 "${URI}" /tmp/identities.edn > /tmp/check-index.edn

potetm19:12:18

I know IAM perms can be a problem here, so I ran the following:

aws dynamodb describe-table --region ${REGION} --table-name ${TABLE_NAME}

potetm19:12:32

Which returns successfully.

potetm20:12:15

In case it’s in question, this is running in AWS using IAM roles on the ec2 instance.

Ben Kamphaus22:12:39

@potetm: that form of invocation with appropriate permissions succeeds fine for me.

potetm22:12:13

@bkamphaus: Yeah we ran it in one VPC and it worked fine.

potetm22:12:23

This one was run in eu-west-1, and it fails.

potetm22:12:50

Is there another way I could check perms?

Ben Kamphaus22:12:45

@potetm: can a repl from the same machine connect? You can use bin/repl or a script invoked with bin/run on the same instance.

Ben Kamphaus22:12:20

if you have enough for a repl to connect + the appropriate describe-table permission, the diagnostic tool should be able to run in detect mode fine.

potetm22:12:27

Running (d/connect “${URI}”) appears to work fine from bin/repl.

potetm22:12:14

I’m able to call (d/db conn) and get a db instance back.

potetm22:12:04

Anything else I can run to get more info?

potetm22:12:12

Also don’t mind giving more specifics in a 1-on-1 or via zendesk or whatever. Tried to anonymize what I posted in here.

Ben Kamphaus22:12:17

@potetm:Yeah, can you open a support ticket and I’ll follow through on ZenDesk? I want to verify details that aren’t anonymized if possible. I would suspect what your’e doing should work if you have peer + describe-table permissions (assuming the aws invocation you used is sufficient to verify the permissions for that role, or that you’d see a different effort).

Ben Kamphaus22:12:42

Not sure if a basic sanity check on echo $URI makes sense, assuming you would have checked for problem characters, typos, etc.

potetm22:12:05

Yeah I’ve just been filling it in when I type into slack. I’ve checked it a few times w/ a few pairs of eyes. No luck so far.

potetm22:12:15

I’ll put it into the zendesk submission so you can see it too.

davebryand22:12:37

If I have something like :task/due-date which represents the date on which something is due, what is the idiomatic type for this? I’m guessing :db.type/instant with the date set to midnight of the day which the task is due. If that’s right, is index-range http://docs.datomic.com/clojure/index.html#datomic.api/index-range the way I’d query against that field? Thanks!

Ben Kamphaus23:12:21

@potetm: thanks, I’ll respond on ticket.

potetm23:12:29

thanks so much man