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

Server: The server fails to flush the in-memory table if the data file is locked by another process #14

Closed
ohsayan opened this issue Aug 8, 2020 · 5 comments
Labels
C-bug Something isn't working C-storage Relating to storage D-server Related to the server L-Medium Requires a "medium" level of work OS-Windows Windows related P-low Low priority

Comments

@ohsayan
Copy link
Member

ohsayan commented Aug 8, 2020

Description of bug
When the server starts, it only reads from the data.bin file to restore the previously stored data. In the current implementation, if another process locks the file (for some reason, not something predictable) while the server is running, the server quits without flushing the data - with an error message.

There are two solutions to this:

  1. Lock the file (record-level) OR
  2. Wait for the other process to release the lock

For (1): This is fairly easy to implement and is better than (2) since we already have a lock on the file. Also, in the event that a quick shutdown is needed, this would be the most reliable option.
For (2): This is the easiest thing to implement - but there are doubts about how reliable this can be. The lock on the file may never be released and we may never be able to write to it. Also, if a quick shutdown is required, this solution is not favorable at all.

Steps to reproduce
NA

Expected behavior
NA

Meta

  • Release tag: None
  • Branch: None
  • Commit ID: None
  • Operating system: None

Additional context
None

@ohsayan ohsayan added C-bug Something isn't working D-server Related to the server labels Aug 8, 2020
@ohsayan

This comment has been minimized.

@ohsayan

This comment has been minimized.

@ohsayan
Copy link
Member Author

ohsayan commented Aug 8, 2020

Marking this as Windows only since on Windows locking is mandatory by default. This wouldn't be a problem on *nix systems.

@ohsayan ohsayan added OS-Windows Windows related P-medium Medium priority C-storage Relating to storage labels Aug 8, 2020
@ohsayan ohsayan added the L-Medium Requires a "medium" level of work label Aug 26, 2020
@ohsayan
Copy link
Member Author

ohsayan commented Sep 4, 2020

As of now, we keep on looping until we get to write the file to disk, waiting for the user to retry.

Edit: Downgrading to low priority

@ohsayan ohsayan added P-low Low priority and removed P-medium Medium priority labels Sep 4, 2020
@ohsayan
Copy link
Member Author

ohsayan commented Oct 14, 2020

This is a very rare scenario, and isn't something reproducible. I will reopen this when the problem reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working C-storage Relating to storage D-server Related to the server L-Medium Requires a "medium" level of work OS-Windows Windows related P-low Low priority
Projects
None yet
Development

No branches or pull requests

1 participant