mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-11-22 04:36:32 +00:00
Make some parameters experimental and link the dedicated issue
This commit is contained in:
@@ -83,10 +83,11 @@ const MEILI_S3_BUCKET_NAME: &str = "MEILI_S3_BUCKET_NAME";
|
|||||||
const MEILI_S3_SNAPSHOT_PREFIX: &str = "MEILI_S3_SNAPSHOT_PREFIX";
|
const MEILI_S3_SNAPSHOT_PREFIX: &str = "MEILI_S3_SNAPSHOT_PREFIX";
|
||||||
const MEILI_S3_ACCESS_KEY: &str = "MEILI_S3_ACCESS_KEY";
|
const MEILI_S3_ACCESS_KEY: &str = "MEILI_S3_ACCESS_KEY";
|
||||||
const MEILI_S3_SECRET_KEY: &str = "MEILI_S3_SECRET_KEY";
|
const MEILI_S3_SECRET_KEY: &str = "MEILI_S3_SECRET_KEY";
|
||||||
const MEILI_S3_MAX_IN_FLIGHT_PARTS: &str = "MEILI_S3_MAX_IN_FLIGHT_PARTS";
|
const MEILI_EXPERIMENTAL_S3_MAX_IN_FLIGHT_PARTS: &str = "MEILI_EXPERIMENTAL_S3_MAX_IN_FLIGHT_PARTS";
|
||||||
const MEILI_S3_COMPRESSION_LEVEL: &str = "MEILI_S3_COMPRESSION_LEVEL";
|
const MEILI_EXPERIMENTAL_S3_COMPRESSION_LEVEL: &str = "MEILI_EXPERIMENTAL_S3_COMPRESSION_LEVEL";
|
||||||
const MEILI_S3_SIGNATURE_DURATION_SECONDS: &str = "MEILI_S3_SIGNATURE_DURATION_SECONDS";
|
const MEILI_EXPERIMENTAL_S3_SIGNATURE_DURATION_SECONDS: &str =
|
||||||
const MEILI_S3_MULTIPART_PART_SIZE: &str = "MEILI_S3_MULTIPART_PART_SIZE";
|
"MEILI_EXPERIMENTAL_S3_SIGNATURE_DURATION_SECONDS";
|
||||||
|
const MEILI_EXPERIMENTAL_S3_MULTIPART_PART_SIZE: &str = "MEILI_EXPERIMENTAL_S3_MULTIPART_PART_SIZE";
|
||||||
|
|
||||||
const DEFAULT_CONFIG_FILE_PATH: &str = "./config.toml";
|
const DEFAULT_CONFIG_FILE_PATH: &str = "./config.toml";
|
||||||
const DEFAULT_DB_PATH: &str = "./data.ms";
|
const DEFAULT_DB_PATH: &str = "./data.ms";
|
||||||
@@ -954,28 +955,36 @@ pub struct S3SnapshotOpts {
|
|||||||
pub s3_secret_key: String,
|
pub s3_secret_key: String,
|
||||||
|
|
||||||
/// The maximum number of parts that can be uploaded in parallel.
|
/// The maximum number of parts that can be uploaded in parallel.
|
||||||
#[clap(long, env = MEILI_S3_MAX_IN_FLIGHT_PARTS, default_value_t = default_s3_snapshot_max_in_flight_parts())]
|
///
|
||||||
#[serde(default = "default_s3_snapshot_max_in_flight_parts")]
|
/// For more information, see <https://github.com/orgs/meilisearch/discussions/869>.
|
||||||
pub s3_max_in_flight_parts: NonZeroUsize,
|
#[clap(long, env = MEILI_EXPERIMENTAL_S3_MAX_IN_FLIGHT_PARTS, default_value_t = default_experimental_s3_snapshot_max_in_flight_parts())]
|
||||||
|
#[serde(default = "default_experimental_s3_snapshot_max_in_flight_parts")]
|
||||||
|
pub experimental_s3_max_in_flight_parts: NonZeroUsize,
|
||||||
|
|
||||||
/// The compression level. Defaults to no compression (0).
|
/// The compression level. Defaults to no compression (0).
|
||||||
#[clap(long, env = MEILI_S3_COMPRESSION_LEVEL, default_value_t = default_s3_snapshot_compression_level())]
|
///
|
||||||
#[serde(default = "default_s3_snapshot_compression_level")]
|
/// For more information, see <https://github.com/orgs/meilisearch/discussions/869>.
|
||||||
pub s3_compression_level: u32,
|
#[clap(long, env = MEILI_EXPERIMENTAL_S3_COMPRESSION_LEVEL, default_value_t = default_experimental_s3_snapshot_compression_level())]
|
||||||
|
#[serde(default = "default_experimental_s3_snapshot_compression_level")]
|
||||||
|
pub experimental_s3_compression_level: u32,
|
||||||
|
|
||||||
/// The signature duration for the multipart upload.
|
/// The signature duration for the multipart upload.
|
||||||
#[clap(long, env = MEILI_S3_SIGNATURE_DURATION_SECONDS, default_value_t = default_s3_snapshot_signature_duration_seconds())]
|
///
|
||||||
#[serde(default = "default_s3_snapshot_signature_duration_seconds")]
|
/// For more information, see <https://github.com/orgs/meilisearch/discussions/869>.
|
||||||
pub s3_signature_duration_seconds: u64,
|
#[clap(long, env = MEILI_EXPERIMENTAL_S3_SIGNATURE_DURATION_SECONDS, default_value_t = default_experimental_s3_snapshot_signature_duration_seconds())]
|
||||||
|
#[serde(default = "default_experimental_s3_snapshot_signature_duration_seconds")]
|
||||||
|
pub experimental_s3_signature_duration_seconds: u64,
|
||||||
|
|
||||||
/// The size of the the multipart parts.
|
/// The size of the the multipart parts.
|
||||||
///
|
///
|
||||||
/// Must not be less than 10MiB and larger than 8GiB. Yes,
|
/// Must not be less than 10MiB and larger than 8GiB. Yes,
|
||||||
/// twice the boundaries of the AWS S3 multipart upload
|
/// twice the boundaries of the AWS S3 multipart upload
|
||||||
/// because we use it a bit differently internally.
|
/// because we use it a bit differently internally.
|
||||||
#[clap(long, env = MEILI_S3_MULTIPART_PART_SIZE, default_value_t = default_s3_snapshot_multipart_part_size())]
|
///
|
||||||
#[serde(default = "default_s3_snapshot_multipart_part_size")]
|
/// For more information, see <https://github.com/orgs/meilisearch/discussions/869>.
|
||||||
pub s3_multipart_part_size: Byte,
|
#[clap(long, env = MEILI_EXPERIMENTAL_S3_MULTIPART_PART_SIZE, default_value_t = default_experimental_s3_snapshot_multipart_part_size())]
|
||||||
|
#[serde(default = "default_experimental_s3_snapshot_multipart_part_size")]
|
||||||
|
pub experimental_s3_multipart_part_size: Byte,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl S3SnapshotOpts {
|
impl S3SnapshotOpts {
|
||||||
@@ -988,10 +997,10 @@ impl S3SnapshotOpts {
|
|||||||
s3_snapshot_prefix,
|
s3_snapshot_prefix,
|
||||||
s3_access_key,
|
s3_access_key,
|
||||||
s3_secret_key,
|
s3_secret_key,
|
||||||
s3_max_in_flight_parts,
|
experimental_s3_max_in_flight_parts,
|
||||||
s3_compression_level,
|
experimental_s3_compression_level,
|
||||||
s3_signature_duration_seconds,
|
experimental_s3_signature_duration_seconds,
|
||||||
s3_multipart_part_size,
|
experimental_s3_multipart_part_size,
|
||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
export_to_env_if_not_present(MEILI_S3_BUCKET_URL, s3_bucket_url);
|
export_to_env_if_not_present(MEILI_S3_BUCKET_URL, s3_bucket_url);
|
||||||
@@ -1001,17 +1010,20 @@ impl S3SnapshotOpts {
|
|||||||
export_to_env_if_not_present(MEILI_S3_ACCESS_KEY, s3_access_key);
|
export_to_env_if_not_present(MEILI_S3_ACCESS_KEY, s3_access_key);
|
||||||
export_to_env_if_not_present(MEILI_S3_SECRET_KEY, s3_secret_key);
|
export_to_env_if_not_present(MEILI_S3_SECRET_KEY, s3_secret_key);
|
||||||
export_to_env_if_not_present(
|
export_to_env_if_not_present(
|
||||||
MEILI_S3_MAX_IN_FLIGHT_PARTS,
|
MEILI_EXPERIMENTAL_S3_MAX_IN_FLIGHT_PARTS,
|
||||||
s3_max_in_flight_parts.to_string(),
|
experimental_s3_max_in_flight_parts.to_string(),
|
||||||
);
|
|
||||||
export_to_env_if_not_present(MEILI_S3_COMPRESSION_LEVEL, s3_compression_level.to_string());
|
|
||||||
export_to_env_if_not_present(
|
|
||||||
MEILI_S3_SIGNATURE_DURATION_SECONDS,
|
|
||||||
s3_signature_duration_seconds.to_string(),
|
|
||||||
);
|
);
|
||||||
export_to_env_if_not_present(
|
export_to_env_if_not_present(
|
||||||
MEILI_S3_MULTIPART_PART_SIZE,
|
MEILI_EXPERIMENTAL_S3_COMPRESSION_LEVEL,
|
||||||
s3_multipart_part_size.to_string(),
|
experimental_s3_compression_level.to_string(),
|
||||||
|
);
|
||||||
|
export_to_env_if_not_present(
|
||||||
|
MEILI_EXPERIMENTAL_S3_SIGNATURE_DURATION_SECONDS,
|
||||||
|
experimental_s3_signature_duration_seconds.to_string(),
|
||||||
|
);
|
||||||
|
export_to_env_if_not_present(
|
||||||
|
MEILI_EXPERIMENTAL_S3_MULTIPART_PART_SIZE,
|
||||||
|
experimental_s3_multipart_part_size.to_string(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1027,10 +1039,10 @@ impl TryFrom<S3SnapshotOpts> for S3SnapshotOptions {
|
|||||||
s3_snapshot_prefix,
|
s3_snapshot_prefix,
|
||||||
s3_access_key,
|
s3_access_key,
|
||||||
s3_secret_key,
|
s3_secret_key,
|
||||||
s3_max_in_flight_parts,
|
experimental_s3_max_in_flight_parts,
|
||||||
s3_compression_level,
|
experimental_s3_compression_level,
|
||||||
s3_signature_duration_seconds,
|
experimental_s3_signature_duration_seconds,
|
||||||
s3_multipart_part_size,
|
experimental_s3_multipart_part_size,
|
||||||
} = other;
|
} = other;
|
||||||
|
|
||||||
Ok(S3SnapshotOptions {
|
Ok(S3SnapshotOptions {
|
||||||
@@ -1040,10 +1052,10 @@ impl TryFrom<S3SnapshotOpts> for S3SnapshotOptions {
|
|||||||
s3_snapshot_prefix,
|
s3_snapshot_prefix,
|
||||||
s3_access_key,
|
s3_access_key,
|
||||||
s3_secret_key,
|
s3_secret_key,
|
||||||
s3_max_in_flight_parts,
|
s3_max_in_flight_parts: experimental_s3_max_in_flight_parts,
|
||||||
s3_compression_level,
|
s3_compression_level: experimental_s3_compression_level,
|
||||||
s3_signature_duration: Duration::from_secs(s3_signature_duration_seconds),
|
s3_signature_duration: Duration::from_secs(experimental_s3_signature_duration_seconds),
|
||||||
s3_multipart_part_size: s3_multipart_part_size.as_u64(),
|
s3_multipart_part_size: experimental_s3_multipart_part_size.as_u64(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1262,19 +1274,19 @@ fn default_snapshot_interval_sec() -> &'static str {
|
|||||||
DEFAULT_SNAPSHOT_INTERVAL_SEC_STR
|
DEFAULT_SNAPSHOT_INTERVAL_SEC_STR
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_s3_snapshot_max_in_flight_parts() -> NonZeroUsize {
|
fn default_experimental_s3_snapshot_max_in_flight_parts() -> NonZeroUsize {
|
||||||
DEFAULT_S3_SNAPSHOT_MAX_IN_FLIGHT_PARTS
|
DEFAULT_S3_SNAPSHOT_MAX_IN_FLIGHT_PARTS
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_s3_snapshot_compression_level() -> u32 {
|
fn default_experimental_s3_snapshot_compression_level() -> u32 {
|
||||||
DEFAULT_S3_SNAPSHOT_COMPRESSION_LEVEL
|
DEFAULT_S3_SNAPSHOT_COMPRESSION_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_s3_snapshot_signature_duration_seconds() -> u64 {
|
fn default_experimental_s3_snapshot_signature_duration_seconds() -> u64 {
|
||||||
DEFAULT_S3_SNAPSHOT_SIGNATURE_DURATION_SECONDS
|
DEFAULT_S3_SNAPSHOT_SIGNATURE_DURATION_SECONDS
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_s3_snapshot_multipart_part_size() -> Byte {
|
fn default_experimental_s3_snapshot_multipart_part_size() -> Byte {
|
||||||
DEFAULT_S3_SNAPSHOT_MULTIPART_PART_SIZE
|
DEFAULT_S3_SNAPSHOT_MULTIPART_PART_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user