Skip to content

Commit ba6a948

Browse files
lmvasquezgfacebook-github-bot
authored andcommitted
modern sync: populate modern sync config
Summary: WTTS Reviewed By: andreacampi Differential Revision: D72212685 fbshipit-source-id: 66bead76c77df8af08c99aa2493bf10e20a135c7
1 parent e48591e commit ba6a948

3 files changed

Lines changed: 69 additions & 3 deletions

File tree

configerator/structs/scm/mononoke/repos/repos.thrift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @generated SignedSource<<e3814ec032fa6c4bfe7ee963fcefba46>>
1+
// @generated SignedSource<<6ea5a4ba8d9103945ab655a4a1b0d80e>>
22
// DO NOT EDIT THIS FILE MANUALLY!
33
// This file is a mechanical copy of the version in the configerator repo. To
44
// modify it, edit the copy in the configerator repo instead and copy it over by
@@ -421,6 +421,21 @@ struct RawHgSyncConfig {
421421
@rust.Exhaustive
422422
struct RawModernSyncConfig {
423423
1: string url;
424+
2: i64 chunk_size;
425+
3: i64 single_db_query_entries_limit;
426+
4: i64 changeset_concurrency;
427+
5: i64 max_blob_bytes;
428+
6: ModernSyncChannelConfig content_channel_config;
429+
7: ModernSyncChannelConfig filenodes_channel_config;
430+
8: ModernSyncChannelConfig trees_channel_config;
431+
9: ModernSyncChannelConfig changesets_channel_config;
432+
}
433+
434+
@rust.Exhaustive
435+
struct ModernSyncChannelConfig {
436+
1: i64 batch_size;
437+
2: i64 channel_size;
438+
3: i64 flush_interval_ms;
424439
}
425440

426441
/// Repo-specific configuration parameters related to mononoke/cas_sync jobs for prod repos

eden/mononoke/metaconfig/parser/src/convert/repo.rs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use metaconfig_types::InfinitepushParams;
3939
use metaconfig_types::LfsParams;
4040
use metaconfig_types::LoggingDestination;
4141
use metaconfig_types::MetadataLoggerConfig;
42+
use metaconfig_types::ModernSyncChannelConfig;
4243
use metaconfig_types::ModernSyncConfig;
4344
use metaconfig_types::MononokeCasSyncConfig;
4445
use metaconfig_types::PushParams;
@@ -68,6 +69,7 @@ use mononoke_types::NonRootMPath;
6869
use mononoke_types::PrefixTrie;
6970
use mononoke_types::RepositoryId;
7071
use regex::Regex;
72+
use repos::ModernSyncChannelConfig as RawModernSyncChannelConfig;
7173
use repos::RawBookmarkConfig;
7274
use repos::RawCacheWarmupConfig;
7375
use repos::RawCasSyncConfig;
@@ -718,7 +720,29 @@ impl Convert for RawModernSyncConfig {
718720
type Output = ModernSyncConfig;
719721

720722
fn convert(self) -> Result<Self::Output> {
721-
Ok(ModernSyncConfig { url: self.url })
723+
Ok(ModernSyncConfig {
724+
url: self.url,
725+
chunk_size: self.chunk_size,
726+
single_db_query_entries_limit: self.single_db_query_entries_limit,
727+
changeset_concurrency: self.changeset_concurrency,
728+
max_blob_bytes: self.max_blob_bytes,
729+
content_channel_config: self.content_channel_config.convert()?,
730+
filenodes_channel_config: self.filenodes_channel_config.convert()?,
731+
trees_channel_config: self.trees_channel_config.convert()?,
732+
changesets_channel_config: self.changesets_channel_config.convert()?,
733+
})
734+
}
735+
}
736+
737+
impl Convert for RawModernSyncChannelConfig {
738+
type Output = ModernSyncChannelConfig;
739+
740+
fn convert(self) -> Result<Self::Output> {
741+
Ok(ModernSyncChannelConfig {
742+
batch_size: self.batch_size,
743+
channel_size: self.channel_size,
744+
flush_interval_ms: self.flush_interval_ms,
745+
})
722746
}
723747
}
724748

eden/mononoke/metaconfig/types/src/lib.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1863,10 +1863,37 @@ pub struct MononokeCasSyncConfig {
18631863
}
18641864

18651865
/// Repo-specific configuration parameters for modern sync job for a specific job variant
1866-
#[derive(Debug, Default, Clone, Eq, PartialEq)]
1866+
#[derive(Debug, Default, Clone, PartialEq, Eq)]
18671867
pub struct ModernSyncConfig {
18681868
/// Edenapi url to use for modern sync
18691869
pub url: String,
1870+
/// Size of each chunk from a big bookmark mve.
1871+
pub chunk_size: i64,
1872+
/// Maximum number of BUL entries to query from a single database transaction.
1873+
pub single_db_query_entries_limit: i64,
1874+
/// Number of concurrent changesets to process.
1875+
pub changeset_concurrency: i64,
1876+
/// Maximum size of blob sent in one query in bytes.
1877+
pub max_blob_bytes: i64,
1878+
/// Configuration for the content channel.
1879+
pub content_channel_config: ModernSyncChannelConfig,
1880+
/// Configuration for the filenodes channel.
1881+
pub filenodes_channel_config: ModernSyncChannelConfig,
1882+
/// Configuration for the trees channel.
1883+
pub trees_channel_config: ModernSyncChannelConfig,
1884+
/// Configuration for the changesets channel.
1885+
pub changesets_channel_config: ModernSyncChannelConfig,
1886+
}
1887+
1888+
/// Configuration for a modern sync channel.
1889+
#[derive(Debug, PartialEq, Default, Clone, Eq)]
1890+
pub struct ModernSyncChannelConfig {
1891+
/// Number of items to include in each batch.
1892+
pub batch_size: i64,
1893+
/// Total number of items to process in the channel.
1894+
pub channel_size: i64,
1895+
/// Interval between flushes in milliseconds.
1896+
pub flush_interval_ms: i64,
18701897
}
18711898

18721899
/// Destination for telemetry logging.

0 commit comments

Comments
 (0)