Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Remove dependence on os.Hostname #142

Open
lieut-data opened this issue Aug 1, 2019 · 5 comments
Open

Remove dependence on os.Hostname #142

lieut-data opened this issue Aug 1, 2019 · 5 comments
Labels
Help Wanted Community help wanted Type/Enhancement New feature or improvement of existing feature
Milestone

Comments

@lieut-data
Copy link
Collaborator

The current code depends on os.Hostname, presumably to avoid multiple servers in a high-availability environment from triggering the same reminders. Unfortunately, this assumes the hostnames are both stable and unique, which may not be true in a k8s/containerized environment.

Using KVCompareAndSet, it should be possible to use a special key value as a cluster-wide mutex for any plugin instance to claim the right to trigger reminders. If all plugins did this on their periodic poll, it would enable any instance to service any reminder without worrying about dual processing. This will be even easier to model with mattermost/mattermost#10960, since we can let the lock "expire" automatically vs. having to manage that part ourselves ala the nps plugin.

@scottleedavis
Copy link
Owner

It is good to know that hostname isn't a stable/unique solution for HA. I had only tested a two node cluster with docker containers in prep for running on community.mattermost.com with success, and I appreciate the broader view.

KVCompareAndSetWithExpiry looks appealing and easy, and as it is slated for v5.16.0 , I will pick this ticket back up as that release gets closer.

@scottleedavis scottleedavis added the Type/Enhancement New feature or improvement of existing feature label Aug 2, 2019
@scottleedavis scottleedavis added this to the 0.5.0 milestone Aug 23, 2019
@variablenix
Copy link

Does the current release of the plugin support HA in a non-k8 environment? I looked around and didn't really find info confirming that remind can operate in a 2-node HA environment without duplicate reminders across both nodes.

@scottleedavis
Copy link
Owner

Hi @variablenix , I have tested in a docker-compose 2 node HA setup with success, though it isn't documented anywhere.

@variablenix
Copy link

Hi @scottleedavis. That is great to know. For context I will also be testing this in a 2-node AWS environment with an ALB. I will report back. Thank you for Reminder bot!

@scottleedavis
Copy link
Owner

@variablenix how did it go in the AWS env w/ALB?

@scottleedavis scottleedavis assigned hanzei and unassigned hanzei May 2, 2020
@scottleedavis scottleedavis added the Help Wanted Community help wanted label May 10, 2020
@scottleedavis scottleedavis modified the milestones: 0.5.0, 0.4.5, 0.4.6 May 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted Community help wanted Type/Enhancement New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

4 participants