Skip to content

Conversation

@paraseba
Copy link
Collaborator

Now configurations can be merged, this means users can pass only the configuration parameters they want to override, not the full object. With this, users don't have to fetch the configuration to be able to open a repository with some config changes.

Example:

Repository::open(
  ...,
  config=RepositoryConfig{inline_chunk_threshold_bytes=0, ..Default::default()})

Will override only inline_chunk_threshold_bytes and keep the rest of the configuration as stored in the repo (or the default config if no persistent configuration is found).

In addition, now we don't store the configuration for the repo on repo creation, unless it's different from the default. This allows us to know the user hasn't changed configuration, which will help with version evolution.

To achieve all this:

  • Now all configuration parameters across all structs are optional
  • We introduce a merge function for configurations


assert (
repr(config)
== r"RepositoryConfig(inline_chunk_threshold_bytes=5, unsafe_overwrite_refs=True, get_partial_values_concurrency=42, compression=CompressionConfig(algorithm=None, level=2), caching=CachingConfig(num_snapshot_nodes=None, num_chunk_refs=8, num_transaction_changes=None, num_bytes_attributes=None, num_bytes_chunks=None), storage=StorageSettings(concurrency=StorageConcurrencySettings(max_concurrent_requests_for_object=5, ideal_concurrent_request_size=1000000)))"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

Now configurations can be merged, this means users can pass only the
configuration parameters they want to override, not the full object.
With this, users don't have to fetch the configuration to be able to
open a repository with some config changes.

Example:

```rust
Repository::open(
  ...,
  config=RepositoryConfig{inline_chunk_threshold_bytes=0, ..Default::default()})
```

Will override only `inline_chunk_threshold_bytes` and keep the rest of
the configuration as stored in the repo (or the default config if no
persistent configuration is found).

In addition, now we don't store the configuration for the repo on repo
creation, unless it's different from the default. This allows us to know
the user hasn't changed configuration, which will help with version
evolution.

To achieve all this:

* Now all configuration parameters across all structs are optional
* We introduce a `merge` function for configurations
@paraseba paraseba merged commit d482e81 into main Jan 23, 2025
4 checks passed
@paraseba paraseba deleted the push-qyvkrxwskpts branch January 23, 2025 19:51
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.

3 participants