nox
nox copied to clipboard
Add builtin: srv remove_alias
scenario:
- deploy new service
- migrate data
- remove alias from old service
- add alias to new service
related: https://github.com/fluencelabs/fluence/issues/1131
You can do it like this: https://github.com/fluencelabs/aqua-dht/blob/7942e40d5f505f6b859e536433235be77578f4cd/alias.air
- Check if alias resolves to the old service
- Deploy new service
- Migrate data
- Add alias to the new service
- Remove old service (not just alias - why leave service running?)
Steps 4 & 5 can be swapped if needed
what happens if there are 2 aliases at same time why service is running always? I thought it only data retained. Is removal lazy? What if removal fails? E.g. somebody uses services .tmp file and removal fails when locked. I do not think that proposed approach is robust. I want to remove and make node without service at all. So on retry will be idempotent.
see related issues - why it is possible to have 2 same aliases on same node?
E.g. somebody uses services .tmp file and removal fails when locked.
It's not possible to use service's /tmp from outside the service, so this situation isn't possible if I understand you correctly.
What if removal fails?
You can have XOR and simply repeat the operation. Same if remove_alias
fails. Though I see no reasons for service removal to fail - it's a pretty simple unconditional operation.
I want to remove and make node without service at all. So on retry will be idempotent.
First, I agree that we need to have remove_alias
builtin.
But regarding the idempotency, I don't see how it's achievable here either with remove_alias
or with srv remove
.
If you retry remove_alias
, you can remove newly added alias that you didn't know about, so it's not idempotent. Same with srv remove
.
It's not possible to use service's /tmp from outside the service, so this situation isn't possible if I understand you correctly.
user runs services, deploy removes services. does remove waits deletion? i mean if i delete during particle running via it and saves data to .tmp. and i try to delete .tmp same time - one service.
i mean if i delete during particle running via it and saves data to .tmp. and i try to delete .tmp same time - one service.
Particles access services in a sequential manner, i.e. it's not possible to access service concurrently from several particles
Particles access services in a sequential manner, i.e. it's not possible to access service concurrently from several particles
that should be very cleared state in docs. as it very important for scale. and there should be option for concurrent access for stateless services. may be.
with current design will need to deploy services per company unit or even chat, not per company.
if you are ok to consider to remove alias, than i am ok. at least as feature. read is as k8s labels and selectors.
Check if alias resolves to the old service
Deploy new service
Migrate data
Add alias to the new service
Remove old service (not just alias - why leave service running?)
May be so that is okey. But imagine I want to add my alias to other owner service with my private prefix key? like if that iam want to rout my particles via it. or I want to do A/B/Canary releases?
but yeah, for now will loop over services, find aliased, find id and remove services. also it would be shorter to remove alias. i do not care of garbage. GC is not my prio. there should be other economics.