Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions quickwit/quickwit-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ pub use crate::node_config::{
};
use crate::source_config::serialize::{SourceConfigV0_7, SourceConfigV0_8, VersionedSourceConfig};
pub use crate::storage_config::{
AzureStorageConfig, FileStorageConfig, GoogleCloudStorageConfig, RamStorageConfig,
S3StorageConfig, StorageBackend, StorageBackendFlavor, StorageConfig, StorageConfigs,
AzureStorageConfig, ChecksumStrategy, FileStorageConfig, GoogleCloudStorageConfig,
RamStorageConfig, S3StorageConfig, StorageBackend, StorageBackendFlavor, StorageConfig,
StorageConfigs,
};

/// Returns true if the ingest API v2 is enabled.
Expand Down
30 changes: 22 additions & 8 deletions quickwit/quickwit-config/src/storage_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ pub enum StorageBackend {
S3,
}

/// Strategy used to checksum object-storage uploads.
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ChecksumStrategy {
Comment thread
nadav-govari marked this conversation as resolved.
/// CRC32C, computed and validated by the AWS SDK. Native S3 default.
#[default]
Crc32c,
/// MD5 (Content-MD5 header), computed client-side. Used by S3-compatible
/// implementations that predate the SDK's `x-amz-checksum-*` headers.
Md5,
/// No upload checksum is sent and no response checksum is validated.
Disabled,
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum StorageBackendFlavor {
Expand Down Expand Up @@ -330,7 +344,7 @@ pub struct S3StorageConfig {
#[serde(default)]
pub disable_multipart_upload: bool,
#[serde(default)]
pub disable_checksums: bool,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that does not look backward compatible. I think noone uses it, and they will get a clear error message, so it is probably ok if it is a calculated risk.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nadav, you can make this backward compatible with some serde trick. We can use an alias and then deserialize false to disabled and true to the new default.

pub checksum_strategy: ChecksumStrategy,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also update docs/configuration/storage-config.md

#[serde(default)]
pub disable_stalled_stream_protection_upload: bool,
#[serde(default)]
Expand All @@ -343,22 +357,22 @@ impl S3StorageConfig {
Some(StorageBackendFlavor::DigitalOcean) => {
self.force_path_style_access = true;
self.disable_multi_object_delete = true;
self.disable_checksums = true;
self.checksum_strategy = ChecksumStrategy::Disabled;
}
Some(StorageBackendFlavor::Garage) => {
self.region = Some("garage".to_string());
self.force_path_style_access = true;
self.disable_checksums = true;
self.checksum_strategy = ChecksumStrategy::Disabled;
}
Some(StorageBackendFlavor::Gcs) => {
self.disable_multi_object_delete = true;
self.disable_multipart_upload = true;
self.disable_checksums = true;
self.checksum_strategy = ChecksumStrategy::Disabled;
}
Some(StorageBackendFlavor::MinIO) => {
self.region = Some("minio".to_string());
self.force_path_style_access = true;
self.disable_checksums = true;
self.checksum_strategy = ChecksumStrategy::Disabled;
Comment on lines +360 to +375
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Garage and MinIO support crc32c (source: git history), Ceph documentation mention crc32c so i assume DO has it too, and guilload said Gcs supports it to, i think we can leave the checksum strategy as default for all flavours unless we end up with reports that it causes issues

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

guilload said Gcs supports it to > I am not sure this is correct, but I think we use a specific client for GS no?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

DO support: https://docs.digitalocean.com/reference/api/spaces/ (its supported)
To use CRC32C, you have to supply a GCP-specific header, which we won't be able to do from the S3 SDK. So I'll leave it disabled for GCS and enable it for the other two.

}
_ => {}
}
Expand Down Expand Up @@ -404,7 +418,7 @@ impl fmt::Debug for S3StorageConfig {
&self.disable_multi_object_delete,
)
.field("disable_multipart_upload", &self.disable_multipart_upload)
.field("disable_checksums", &self.disable_checksums)
.field("checksum_strategy", &self.checksum_strategy)
.field(
"disable_stalled_stream_protection_upload",
&self.disable_stalled_stream_protection_upload,
Expand Down Expand Up @@ -647,7 +661,7 @@ mod tests {
force_path_style_access: true
disable_multi_object_delete_requests: true
disable_multipart_upload: true
disable_checksums: true
checksum_strategy: disabled
disable_stalled_stream_protection_upload: true
disable_stalled_stream_protection_download: true
"#;
Expand All @@ -660,7 +674,7 @@ mod tests {
force_path_style_access: true,
disable_multi_object_delete: true,
disable_multipart_upload: true,
disable_checksums: true,
checksum_strategy: ChecksumStrategy::Disabled,
disable_stalled_stream_protection_upload: true,
disable_stalled_stream_protection_download: true,
..Default::default()
Expand Down
Loading
Loading