Skip to content

"testing/" directory remains after formatting volume with shards #6576

@Light-City

Description

@Light-City

What happened:

When formatting a new volume with --shards > 0 (e.g., --shards=10 --bucket=s3://mybucket/data-%d), the test directory testing/ is not cleaned up from the object storage.

The root cause is that sharded.pick(key) hashes the entire key string. During the format test:
A test object is created with a key like testing/abcdefg. It is hashed and routed to Shard A.
After the test, the command attempts to delete the prefix testing/. However, the string testing/ hashes to a different value, routing the request to Shard B.

What you expected to happen:

should delete testing dir.

How to reproduce it (as minimally and precisely as possible):

cmd is:

./juicefs format redis://127.0.0.1:6379 myjfs --shards=120 --bucket=metadata/juicefs-%d

Anything else we need to know?

Environment:

  • JuiceFS version (use juicefs --version) or Hadoop Java SDK version: 1.4.0-dev+2026-01-01.f1701da0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions