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

allow to configure qdrant init file with env variable #2316

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

generall
Copy link
Member

Improvement for cloud support of recovery mode:
Allow to configure star-up indicator file path using env variable

@generall generall requested review from elbart and timvisee July 24, 2023 09:30
@timvisee timvisee merged commit 0ccca76 into dev Jul 24, 2023
log::warn!("Failed to create init file indicator: {}", err);
}
}

/// Removes a file that indicates that the server has been started.
/// Use before server initialization to avoid false positives.
pub fn remove_started_file_indicator() {
if std::path::Path::new(INITIALIZED_FILE).exists() {
if let Err(err) = std::fs::remove_file(INITIALIZED_FILE) {
let path = get_init_file_path();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a "migration"-issue here? In case somebody changes this path via an ENV var between two runs, the old file would not be cleaned up. The old file would not be considered for any logic internally, since the path changed but it still remains on disk. So this is the obligation of the caller to delete irritating old files then?

Copy link
Member

@timvisee timvisee Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. But I think that is impossible to fix without using a common prefix.

But it will only be left behind if initialization fails, as it is cleaned up right after.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth to have a one sentence documentation addition somewhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add docs for the user to be careful, or to describe when this file is created and cleaned up?

In both cases: sure!

generall added a commit that referenced this pull request Jul 31, 2023
* allow to configure qdrant init file with env variable

* Return path type from get_init_file_path

---------

Co-authored-by: timvisee <tim@visee.me>
@timvisee timvisee deleted the configurable-startup-file branch November 3, 2023 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants