-
-
Notifications
You must be signed in to change notification settings - Fork 153
Proper Error Message if the Storage is in an invalid state #623
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
Conversation
server/src/option.rs
Outdated
Ok(()) | ||
} else if has_parseable_json && !has_streams { | ||
Err(ObjectStorageError::Custom( | ||
"Parseable config found, but the Storage contains some stale data.".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please correct the error to -
Could not start the server because storage contains stale data from previous deployment, please choose an empty storage and restart the server. Join us on Parseable Slack to report this incident : https://launchpass.com/parseable
Also, Parseable.json file gets created in storage, staging directory gets created, parseable.json gets created in staging -- none of these should happen in case of error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error will be triggered if someone added some data to the storage where parseable stores data.
This case is the least likeliest to happen.
server/src/option.rs
Outdated
)) | ||
} else if !has_parseable_json && !has_streams && !has_dirs { | ||
Err(ObjectStorageError::Custom( | ||
"Storage contains some stale data, Please provide an Empty Storage".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide the scenario when can this happen -!has_parseable_json && !has_streams && !has_dirs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable has_dirs
does not properly convey the intention.
In this case .parseable.json
, folders with .stream.json
do not exists, but there is some data present in the storage.
This will happen if parseable is given a storage that is not empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am updating the logic of the if condition, so the intention is clearer.
server/src/option.rs
Outdated
)) | ||
} else { | ||
Err(ObjectStorageError::Custom( | ||
"Parseable config is missing, but streams are present in Storage.\nJoin us on Parseable Slack" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide the scenario when can this happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is again a highly unlikely scenario to happen.
This error will be triggered if .parseable.json
was deleted from the storage manually.
)) | ||
} else if !has_parseable_json && !has_streams && has_dirs { | ||
Err(ObjectStorageError::Custom( | ||
"Could not start the server because storage contains some stale data, please provide an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eshanatnight please update to below error
"Could not start the server because storage indicates stale data not related to parseable, please choose an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable"
)) | ||
} else { | ||
Err(ObjectStorageError::Custom( | ||
"Could not start the server because storage contains stale data from previous deployment.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eshanatnight please update to below error
"Could not start the server because storage indicates stale data from previous deployment, please choose an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable"
Ok(()) | ||
} else if has_parseable_json && !has_streams { | ||
Err(ObjectStorageError::Custom( | ||
"Could not start the server because storage contains stale data from previous deployment, please choose an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eshanatnight please update to below error message
"Could not start the server because storage indicates stale data from previous deployment, please choose an empty storage and restart the server.\nJoin us on Parseable Slack to report this incident : launchpass.com/parseable"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Eshanatnight please change the error messages as per the comments, rest all look good. I have tested the scenarios and all scenarios work as expected.
@nitisht once Eshan makes the error messages consistent, we are good to merge this PR as well.
Merging now, I'll fix the error message in next PR. |
Fixes #615.
Description
Return the proper Error Message if the Data Store is in an invalid state.
Invalid States
.parseable.json
does not exists but directories with.stream.json
exist.parseable.json
does not exists but directories with.stream.json
do not exist.parseable.json
does not exists and directories without.stream.json
existsAdded a validation step to check if the Storage Location is in a valid state.
ObjectStorage
:async fn list_dirs_in_storage(&self) -> Result<Vec<String>, ObjectStorageError>
localfs
ands3
This PR has: