seaweedfs/weed/filer
Chris Lu c284e51d20
fix: multipart upload ETag calculation (#8238)
* fix multipart etag

* address comments

* clean up

* clean up

* optimization

* address comments

* unquoted etag

* dedup

* upgrade

* clean

* etag

* return quoted tag

* quoted etag

* debug

* s3api: unify ETag retrieval and quoting across handlers

Refactor newListEntry to take *S3ApiServer and use getObjectETag,
and update setResponseHeaders to use the same logic. This ensures
consistent ETags are returned for both listing and direct access.

* s3api: implement ListObjects deduplication for versioned buckets

Handle duplicate entries between the main path and the .versions
directory by prioritizing the latest version when bucket versioning
is enabled.

* s3api: cleanup stale main file entries during versioned uploads

Add explicit deletion of pre-existing "main" files when creating new
versions in versioned buckets. This prevents stale entries from
appearing in bucket listings and ensures consistency.

* s3api: fix cleanup code placement in versioned uploads

Correct the placement of rm calls in completeMultipartUpload and
putVersionedObject to ensure stale main files are properly deleted
during versioned uploads.

* s3api: improve getObjectETag fallback for empty ExtETagKey

Ensure that when ExtETagKey exists but contains an empty value,
the function falls through to MD5/chunk-based calculation instead
of returning an empty string.

* s3api: fix test files for new newListEntry signature

Update test files to use the new newListEntry signature where the
first parameter is *S3ApiServer. Created mockS3ApiServer to properly
test owner display name lookup functionality.

* s3api: use filer.ETag for consistent Md5 handling in getEtagFromEntry

Change getEtagFromEntry fallback to use filer.ETag(entry) instead of
filer.ETagChunks to ensure legacy entries with Attributes.Md5 are
handled consistently with the rest of the codebase.

* s3api: optimize list logic and fix conditional header logging

- Hoist bucket versioning check out of per-entry callback to avoid
  repeated getVersioningState calls
- Extract appendOrDedup helper function to eliminate duplicate
  dedup/append logic across multiple code paths
- Change If-Match mismatch logging from glog.Errorf to glog.V(3).Infof
  and remove DEBUG prefix for consistency

* s3api: fix test mock to properly initialize IAM accounts

Fixed nil pointer dereference in TestNewListEntryOwnerDisplayName by
directly initializing the IdentityAccessManagement.accounts map in the
test setup. This ensures newListEntry can properly look up account
display names without panicking.

* cleanup

* s3api: remove premature main file cleanup in versioned uploads

Removed incorrect cleanup logic that was deleting main files during
versioned uploads. This was causing test failures because it deleted
objects that should have been preserved as null versions when
versioning was first enabled. The deduplication logic in listing is
sufficient to handle duplicate entries without deleting files during
upload.

* s3api: add empty-value guard to getEtagFromEntry

Added the same empty-value guard used in getObjectETag to prevent
returning quoted empty strings. When ExtETagKey exists but is empty,
the function now falls through to filer.ETag calculation instead of
returning "".

* s3api: fix listing of directory key objects with matching prefix

Revert prefix handling logic to use strings.TrimPrefix instead of
checking HasPrefix with empty string result. This ensures that when a
directory key object exactly matches the prefix (e.g. prefix="dir/",
object="dir/"), it is correctly handled as a regular entry instead of
being skipped or incorrectly processed as a common prefix. Also fixed
missing variable definition.

* s3api: refactor list inline dedup to use appendOrDedup helper

Refactored the inline deduplication logic in listFilerEntries to use the
shared appendOrDedup helper function. This ensures consistent behavior
and reduces code duplication.

* test: fix port allocation race in s3tables integration test

Updated startMiniCluster to find all required ports simultaneously using
findAvailablePorts instead of sequentially. This prevents race conditions
where the OS reallocates a port that was just released, causing multiple
services (e.g. Filer and Volume) to be assigned the same port and fail
to start.
2026-02-06 21:54:43 -08:00
..
abstract_sql Fix chown Input/output error on large file sets (#7996) 2026-01-09 18:02:59 -08:00
arangodb chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
cassandra feat: add TLS configuration options for Cassandra2 store (#7998) 2026-01-14 17:59:59 -08:00
cassandra2 feat: add TLS configuration options for Cassandra2 store (#7998) 2026-01-14 17:59:59 -08:00
elastic/v7 Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
empty_folder_cleanup filer: auto clean empty implicit s3 folders (#8051) 2026-01-17 22:10:15 -08:00
etcd chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
foundationdb filer: improve FoundationDB performance by disabling batch by default (#7770) 2025-12-15 13:03:34 -08:00
hbase chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
leveldb chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
leveldb2 chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
leveldb3 chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
mongodb fix: comprehensive go vet error fixes and add CI enforcement (#7861) 2025-12-23 14:48:50 -08:00
mysql Fix chown Input/output error on large file sets (#7996) 2026-01-09 18:02:59 -08:00
mysql2 print only adapted url 2024-03-25 12:50:43 -07:00
postgres Filer Store: postgres backend support pgbouncer (#7077) 2025-08-03 11:56:04 -07:00
postgres2 Filer Store: postgres backend support pgbouncer (#7077) 2025-08-03 11:56:04 -07:00
redis Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
redis2 chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
redis3 chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
redis_lua chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
rocksdb Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
sqlite serialize sqlite operations 2022-10-12 00:03:27 -07:00
store_test Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
tarantool Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
tikv Add keyPrefix support for TiKV store (#7756) 2025-12-14 23:40:01 -08:00
ydb chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
configuration.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
entry_codec.go Reduce memory allocations in hot paths (#7725) 2025-12-12 12:51:48 -08:00
entry.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filechunk_group_test.go Context cancellation during reading range reading large files (#7093) 2025-08-06 10:09:26 -07:00
filechunk_group.go mount: improve read throughput with parallel chunk fetching (#7569) 2025-11-29 10:06:11 -08:00
filechunk_manifest_test.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
filechunk_manifest.go Fix S3 Gateway Read Failover #8076 (#8087) 2026-01-22 14:07:24 -08:00
filechunk_section_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filechunk_section.go mount: improve read throughput with parallel chunk fetching (#7569) 2025-11-29 10:06:11 -08:00
filechunks2_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filechunks_read_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filechunks_read.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filechunks_test.go S3 API: Advanced IAM System (#7160) 2025-08-30 11:15:48 -07:00
filechunks.go fix: multipart upload ETag calculation (#8238) 2026-02-06 21:54:43 -08:00
filer_buckets.go Prevent bucket renaming in filer, fuse mount, and S3 (#8048) 2026-01-16 19:48:09 -08:00
filer_conf_test.go Reduce memory allocations in hot paths (#7725) 2025-12-12 12:51:48 -08:00
filer_conf.go Reduce memory allocations in hot paths (#7725) 2025-12-12 12:51:48 -08:00
filer_delete_entry.go Prevent bucket renaming in filer, fuse mount, and S3 (#8048) 2026-01-16 19:48:09 -08:00
filer_deletion_test.go Filer: Add retry mechanism for failed file deletions (#7402) 2025-10-29 18:31:23 -07:00
filer_deletion.go Filer: Add retry mechanism for failed file deletions (#7402) 2025-10-29 18:31:23 -07:00
filer_hardlink.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
filer_notify_append.go fix: include DiskType in metadata log volume assignment (#7918) 2025-12-30 17:32:33 -08:00
filer_notify_read.go fix: skip log files with deleted volumes in filer backup (#7692) 2025-12-09 19:03:15 -08:00
filer_notify_test.go refactor filer_pb.Entry and filer.Entry to use GetChunks() 2022-11-15 06:33:36 -08:00
filer_notify.go fix: skip log files with deleted volumes in filer backup (#7692) 2025-12-09 19:03:15 -08:00
filer_on_meta_event.go filer: async empty folder cleanup via metadata events (#7614) 2025-12-03 21:12:19 -08:00
filer_rename.go Prevent bucket renaming in filer, fuse mount, and S3 (#8048) 2026-01-16 19:48:09 -08:00
filer_search.go filer: async empty folder cleanup via metadata events (#7614) 2025-12-03 21:12:19 -08:00
filer.go filer: auto clean empty implicit s3 folders (#8051) 2026-01-17 22:10:15 -08:00
filerstore_hardlink.go Changes logging function (#6919) 2025-06-24 08:44:06 -07:00
filerstore_translate_path.go Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
filerstore_wrapper.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
filerstore.go Add error list each entry func (#7485) 2025-11-25 19:35:19 -08:00
interval_list_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
interval_list.go Mount concurrent read (#4400) 2023-04-13 22:32:45 -07:00
meta_aggregator.go Fix unaligned 64-bit atomic operation on ARM32 (#7958) (#7959) 2026-01-04 11:34:17 -08:00
meta_replay.go "golang.org/x/exp/slices" => "slices" and go fmt 2024-12-19 19:25:06 -08:00
read_remote.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
read_write.go added context to filer_client method calls (#6808) 2025-05-22 09:46:49 -07:00
reader_at_test.go Context cancellation during reading range reading large files (#7093) 2025-08-06 10:09:26 -07:00
reader_at.go mount: improve read throughput with parallel chunk fetching (#7627) 2025-12-04 23:40:56 -08:00
reader_cache_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
reader_cache.go mount: improve read throughput with parallel chunk fetching (#7627) 2025-12-04 23:40:56 -08:00
reader_pattern.go Fix a few data races when reading files in mount (#3527) 2022-08-26 16:41:37 -07:00
remote_mapping.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
remote_storage_test.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
remote_storage.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
s3iam_conf_test.go s3: fix configuring IAM for the same user 2022-08-30 09:37:52 -07:00
s3iam_conf.go convert error fromating to %w everywhere (#6995) 2025-07-16 23:39:27 -07:00
stream_failover_test.go Fix S3 Gateway Read Failover #8076 (#8087) 2026-01-22 14:07:24 -08:00
stream.go Fix S3 Gateway Read Failover #8076 (#8087) 2026-01-22 14:07:24 -08:00
topics.go merge current message queue code changes (#6201) 2024-11-04 12:08:25 -08:00