yuskr
yuskr

Reputation: 3

Orion-LD tenant issue in multiple instance environment

In my environment, multiple OrionLD instances are running on a Kubernetes cluster.

The environment consists of two OrionLD(0.8.0) instances , one MongoDB instance, and a LoadBalancer to OrionLD.

I created an entity with a new tenant by using "NGSILD-Tenant" header. Next, when I tried to retrieve it with "GET /entities", sometimes the retrieval succeeded, and sometimes it failed.

The error message was below.

{
    "type": "https://uri.etsi.org/ngsi-ld/errors/NonExistingTenant",
    "title": "No such tenant",
    "detail": "Tenant01"
}

It seems that one OrionLD instance can recognize the new tenant, but the other cannot.

What is a possible cause of this issue?

Thanks.

Upvotes: 0

Views: 275

Answers (2)

kzangeli
kzangeli

Reputation: 448

So, as it seemed, the bug was mine and it has been fixed and accepted (just to clarify this now "non-issue")

Upvotes: 0

kzangeli
kzangeli

Reputation: 448

ok, this seems to be a problem in the broker. Create an issue on Orion-LD's github, please: https://github.com/FIWARE/context.Orion-LD/issues.

I recently implemented tenant checks for retrievals. It's OK to create new tenants on the fly (entity create operations), but for queries, the tenant must exist already, and the list is in RAM. Meaning, only the broker that created the entity knows about the tenant. It completely explains your problem. I didn't think about this use case, but you are absolutely right. I will have to improve the way I check for "tenant exists" for retrieval operations.

Upvotes: 1

Related Questions