Skip to content

fix: change the way object metadata is stored in posix#1920

Merged
benmcclelland merged 1 commit intomainfrom
sis/posix-object-metadata
Mar 6, 2026
Merged

fix: change the way object metadata is stored in posix#1920
benmcclelland merged 1 commit intomainfrom
sis/posix-object-metadata

Conversation

@niksis02
Copy link
Contributor

@niksis02 niksis02 commented Mar 3, 2026

Fixes #1909

Previously, the mapping between object metadata and posix object was as follows: for each metadata key, we stored a separate xattr with the user.X-Amz-Meta.<key> prefix. This resulted in syscall overhead when storing and deleting large numbers of metadata keys. In addition, very long metadata keys caused failures because most posix filesystems limit xattr key lengths to 127–255 bytes, while S3 does not enforce such a per-key limit.

The logic has now been changed so that all object metadata is stored in a single xattr, user.metadata, as a JSON key/value object. For backward compatibility, metadata GET operations still fall back to the old mechanism (metadata key -> xattr key) when user.metadata is not present.

A new CLI utility has been added to convert all legacy object metadata to the new metadata format within the provided directory.

Example usage:

versitygw utils convert-xattr-metadata path/to/bucket

or

versitygw utils cxm path/to/bucket

It is recommended to run this command on bucket directories to convert all legacy metadata for every object in the bucket.

@niksis02 niksis02 requested a review from benmcclelland March 3, 2026 15:25
@niksis02 niksis02 self-assigned this Mar 3, 2026
Fixes #1909

Previously, the mapping between object metadata and posix object was as follows: for each metadata key, we stored a separate xattr with the `user.X-Amz-Meta.<key>` prefix. This resulted in syscall overhead when storing and deleting large numbers of metadata keys.
In addition, very long metadata keys caused failures because most posix filesystems limit xattr key lengths to 127–255 bytes, while S3 does not enforce such a per-key limit.

The logic has now been changed so that all object metadata is stored in a single xattr, `user.metadata`, as a JSON key/value object. For backward compatibility, metadata GET operations still fall back to the old mechanism (`metadata key -> xattr key`) when `user.metadata` is not present.

A new CLI utility has been added to convert all legacy object metadata to the new metadata format within the provided directory.

**Example usage:**

```
versitygw utils convert-xattr-metadata path/to/bucket
```

or

```
versitygw utils cxm path/to/bucket
```

It is recommended to run this command on bucket directories to convert all legacy metadata for every object in the bucket.
@niksis02 niksis02 force-pushed the sis/posix-object-metadata branch from c282667 to 97bb705 Compare March 5, 2026 21:44
@niksis02 niksis02 requested a review from benmcclelland March 5, 2026 22:11
@benmcclelland benmcclelland merged commit 6281391 into main Mar 6, 2026
118 checks passed
@benmcclelland benmcclelland deleted the sis/posix-object-metadata branch March 6, 2026 01:07
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.

[Bug] - InternalError - object metadata long keys

2 participants