-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Service Arch
-
Service Arch 2021-02-22, Service Arch 2021-03-08, Service Arch 2021-03-22, Service Arch 2021-04-05, Service Arch 2021-04-19, Service Arch 2021-05-17, Service Arch 2021-05-31
An instance can fail to insert its state doc because the instance conflicts with a running instance:
- TenantMigrationDonor instances check in the op observer (that code is called from here) if an instance with the same tenantId already exists
- TenantMigrationRecipient instances check manually against config.tenantMigrationRecipients if an instance with the same tenantId already exists
In both cases, we have made the instance fail with ConflictingOperationInProgress.
For now, we have made the command that creates the instance handle removing the instance from the in-memory map in this case, e.g. here.
It would be better for the POS machinery to handle this. There are two options:
- Make the instance remove itself from its service if the instance fails to insert its state doc. This requires instances to have a pointer to their service.
- Make the service remove the instance if the instance fails to insert its state doc. This requires services to monitor what their instances complete with.
suganthi.mani and I think the second option is cleaner.