Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronise player data loading and saving across multiple servers #180

Open
LMBishop opened this issue Jun 21, 2021 · 0 comments
Open

Synchronise player data loading and saving across multiple servers #180

LMBishop opened this issue Jun 21, 2021 · 0 comments
Labels
enhancement help wanted status: accepted Feature request accepted / bug report confirmed

Comments

@LMBishop
Copy link
Owner

LMBishop commented Jun 21, 2021

Allowing players to to connect directly to another server on BungeeCord using the same database will result in the new server loading stale data. This occurs as BungeeCord establishes a connection with the new server before disconnecting the player from the old one, leading to the new server loading player data before the old server has saved it.

A potential solution to this issue was to use BungeeCord to synchronise the saving and loading of player data. This would have used the plugin messaging channel to request a lock to load the player data, and release it when the data is saved after the player has disconnected from the Spigot server, allowing the next server to acquire the lock and load up-to-date data. However, the main caveat to this approach is requiring that another player be online on the old server, to allow it to release the lock over the plugin messaging channel. This means that using plugin messaging channels for communication in this way is simply unfeasible.

Description of Feature
A way to synchronise player loading and saving.

Alternative Methods

  • Using the plugin messaging channel and the proxy server to keep the lock state. The pitfalls of this approach have already been discussed above.
  • Delaying player loads on join. This is the only workaround Quests provides to this problem, and does not get rid of the race condition.
  • Writing to the database on every local change. This also does not get rid of the race condition, though greatly reduces the chance of lost data.
  • Using something like Redis to keep the lock state. I have no experience with Redis whatsoever.

Additional Information
A solution using the plugin messaging channels has already been partly implemented, though was abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted status: accepted Feature request accepted / bug report confirmed
Projects
None yet
Development

No branches or pull requests

1 participant