Skip to content

[CELEBORN-XXXX] Skip memory file storage for replica partitions - #3859

Draft
venkata91 wants to merge 1 commit into
apache:mainfrom
venkata91:CELEBORN-replica-skip-memory-tier
Draft

venkata91 wants to merge 1 commit into
apache:mainfrom
venkata91:CELEBORN-replica-skip-memory-tier

Conversation

@venkata91

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add a worker config celeborn.worker.memoryFileStorage.replica.enabled (default false). When it is disabled, StoragePolicy skips MEMORY for partitions whose PartitionLocation mode is REPLICA, so replica files fall through to the next storage type in celeborn.worker.storage.storagePolicy.createFilePolicy (e.g. SSD/HDD/DFS). Primary partitions keep using memory file storage as before.

Why are the changes needed?

When memory file storage is enabled (celeborn.worker.directMemoryRatioForMemoryFileStorage > 0), StoragePolicy#createFileWriter always tries MEMORY first and does not distinguish primary from replica partitions (Controller#createPartitionDataWriter receives isPrimary but only uses it to look up an existing working partition). With replication enabled, roughly half of the memory file storage budget, which also counts toward the pause-push thresholds, is spent on replica data. Replica data is only read when fetching from the primary fails, and in that case reading from disk is acceptable. Keeping replicas out of memory leaves memory for data that reducers actually read and delays eviction and push pauses.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

Adds the new worker config celeborn.worker.memoryFileStorage.replica.enabled (default false). With the default, replica partitions are no longer stored in memory file storage. Set it to true to restore the previous behavior.

How was this patch tested?

  • Added StoragePolicyReplicaSuite, which covers: primary goes to memory, replica skips memory by default, and replica goes to memory when the config is enabled.
  • build/mvn test -pl worker -DwildcardSuites=org.apache.celeborn.service.deploy.worker.storage.storagePolicy -Dtest=none (JDK 17): passed, 8 tests.
  • build/mvn test -pl common -DwildcardSuites=org.apache.celeborn.ConfigurationSuite -Dtest=none (JDK 17): passed, docs in sync.

Replica partitions are only read when fetching from the primary fails, but
StoragePolicy placed them in memory file storage just like primary
partitions. Add celeborn.worker.memoryFileStorage.replica.enabled (default
false) so replica partitions fall through to the next storage type and
memory file storage is reserved for primary partitions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant