-
Notifications
You must be signed in to change notification settings - Fork 58
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
Data Inconsistency When Players Switch Servers with MySQL Sync #514
Comments
does anything show up in the logs? or is it only visible in the database? |
Neither the database nor the server logs show anything; the data is simply lost. |
if you dont mind and join the discord server, please create a ticket in the support forum, so the devs can help you more directly: |
What's providing the MySQL db. is it hosted on the server, or is it remote or? |
on server,not remote |
this is kinda expected as cross server sync is difficult by default and adapt wasn't even remotely designed for that |
I used to write plugins that required cross-server communication through a database, and I encountered the same issue where data couldn't synchronize correctly. My solution was to add a timestamp to the database to determine whether the current data was being used by any server. If it was occupied, I would wait until the occupation was released before loading the data. |
I just took a look at the implementation of Adapt, and it seems that using locking in this way would result in extensive code modifications. This is because it appears that the possibility of player data not being loaded yet during skill handling was not considered.🤔 |
yep exactly what I meant with |
if you servers are on the same machine, it's probably the easiest to just use the file storage with symbolic links but even that may have sync problems, which are at least relatively easy to fix |
Actually, this would already cause the same issue as using the database, because the problem lies in the fact that the data isn't being saved in a timely manner. Could you tell me under what circumstances Adapt typically starts saving data? Got it, I'll try adding a locking mechanism myself. |
the current code yes but if you use a file lock only one server will be able to own the data, making desync impossible
|
Description
I encountered an issue when using MySQL to sync player data: there is a chance that data fails to synchronize properly when players switch between servers quickly, resulting in data loss. This is particularly noticeable in scenarios with frequent server switching and negatively impacts the player experience.
Steps to Reproduce
Expected Behavior
I would like a mechanism (e.g., a locking mechanism) to ensure data consistency during server switches, so that no data is lost in the process.
Proposed Solution
Consider implementing a locking mechanism during the synchronization process to prevent related operations or reads until the player's data is fully synchronized. This would help ensure that data remains consistent when players switch servers.
Environment Details
Please let me know if more information or debugging assistance is needed!
The text was updated successfully, but these errors were encountered: