Skip to content

How to write to OrientDB using transactions? (getting "quorum cannot be reached") #283

@abeburnett

Description

@abeburnett

So I've Googled like crazy, and read all the issues here, and all the OrientDB documentation and I cannot for the life of me figure out how to overcome this "quorum" issue.

Here's my code:

    tx = client_db.tx_commit()
    tx.begin()
    attrs = {'@V_organization': {'name': name[0], 'website': website[0], 'city': city[0], 'state': state[0], 'country': country[0]}}
    res = client_db.record_create(-1, attrs)
    tx.attach(res)
    res = tx.commit()

Unforunately the documentation around record_create is super unhelpful (not enough detail), so I'm unsure if submitting different parameters would help. I suspect not.

I suspect the issue is that I'm writing the transaction to a specific machine in the cluster (at a specific IP) and since only that machine receives the new record OrientDB calls it "out of quorum"--i.e., it treats my attempted transaction as an interloper and rejects it.

I get that, but how do I make this work? As far as I can tell there's no option in PyOrient to submit the record change to the cluster as a whole, so I'm mystified how I will achieve quorum and have the transaction accepted.

Can anyone provide some insight on this, and hopefully a solution? It looks like potentially changing the configuration so that writeQuorum=1 might help, but that seems pretty extreme since it could lead to consistency issues. And I'd have to get our system administration folks to make that change, and that doesn't sound ideal.

Any ideas? I'm not super hopeful that I'll hear back here, since this project seems by-and-large abandoned, but I'd love any hints or tips anyone is willing to share.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions