fix(mount): preserve default TTL for legacy mount requests#654
Closed
jlon wants to merge 1 commit intoCurvineIO:mainfrom
Closed
fix(mount): preserve default TTL for legacy mount requests#654jlon wants to merge 1 commit intoCurvineIO:mainfrom
jlon wants to merge 1 commit intoCurvineIO:mainfrom
Conversation
c0848c8 to
e040c41
Compare
bigbigxu
reviewed
Feb 12, 2026
| properties: self.add_properties, | ||
| ttl_ms: self.ttl_ms.unwrap_or(0), | ||
| ttl_action: self.ttl_action.unwrap_or(TtlAction::None), | ||
| ttl_ms: self.ttl_ms.unwrap_or(DEFAULT_MOUNT_TTL_MS), |
Contributor
There was a problem hiding this comment.
If not set, the default value should be 0, meaning the data will not expire.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Mount requests coming from legacy clients (or compatibility paths) may omit
ttl_msandttl_actioninMountOptionsProto.In the previous flow, missing TTL fields were deserialized as
None, then converted intoMountInfoasttl_ms=0andttl_action=none. This disabledauto_cacheand caused read miss paths to fall back to UFS instead of triggering async cache loading.Fix Intent
Ensure mount TTL behavior is stable and backward-compatible when optional TTL fields are missing, while keeping default handling centralized to avoid drift across modules.
Implementation Details
curvine-common/src/state/mount.rs:DEFAULT_MOUNT_TTL_STR(7d)DEFAULT_MOUNT_TTL_ACTION_STR(delete)DEFAULT_MOUNT_TTL_MSDEFAULT_MOUNT_TTL_ACTIONMountOptionsBuilder::new()andMountOptions::to_info()to use these constants.ProtoUtils::mount_options_from_pb():ttl_ms=>DEFAULT_MOUNT_TTL_MSttl_action=>DEFAULT_MOUNT_TTL_ACTIONauto_cache_ttl,default_cache_ttl) to reference the same shared mount TTL string constant.Tests
curvine-tests/tests/mount_ttl_compat_test.rsMountInfodefaultsauto_cache()remains enabledVerification
RUSTC_WRAPPER= cargo check -p curvine-cli -p curvine-commonRUSTC_WRAPPER= cargo test -p curvine-tests --test mount_ttl_compat_test -- --nocapture