mirror of
https://github.com/nspcc-dev/neofs-rest-gw.git
synced 2026-03-01 04:29:14 +00:00
head by_attribute doesn't return the latest created object #113
Labels
No labels
I2
I3
I3
I4
S2
S3
S3
S4
U0
U1
U2
U3
U3
U3
U4
blocked
bug
config
documentation
enhancement
feature
go
help wanted
question
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-rest-gw#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @evgeniiz321 on GitHub (Apr 18, 2025).
Originally assigned to: @smallhive on GitHub.
See https://github.com/nspcc-dev/neofs-testcases/pull/1033,
test_head_by_same_attributeAlso - https://github.com/nspcc-dev/neofs-rest-gw/pull/282
@smallhive commented on GitHub (Apr 18, 2025):
There are two moments to think:
If the test wants to get/head/filter the actual object among similar, it should always remember about https://github.com/nspcc-dev/neofs-s3-gw/pull/1104. It means you should add
time.sleep(1)between each object put. Otherwise, all objects have the same creation timestamp and order is not guaranteed. This means the gate (rest and s3 as well) doesn't have the ability to understand which object is the latest.By default, REST GW doesn't add
timestampattribute to an object. The client should add it manually, or the gate should be configured withpool.default-timestamp: trueto puttimestampattribute to any object on put.Anyway,
UploadContainerObject(It is used in test, but pay attention, it is deprecated) doesn't addtimestampeven withpool.default-timestamp: true.We should consider adding a
timestampfor all objects as a default attribute@roman-khimov commented on GitHub (Apr 21, 2025):
Tests shouldn't use deprecated methods unless they're specifically testing them (which is not the case here).
@evgeniiz321 commented on GitHub (Apr 21, 2025):
@smallhive i updated tests to use the new api, now i got 404 both for get and head operations -
@smallhive commented on GitHub (Apr 22, 2025):
The new method has a slightly different API interface. Custom attributes should be passed in
X-Attributesheader like a JSON mapI suggest updating the gate config and setting up the pool.default-timestamp: true
option. Current test doesn't passTimestamporDate` header; therefore, sorting is not stable@roman-khimov commented on GitHub (Apr 22, 2025):
For a test it can be easier to control timestamps directly. Then a separate test can check
default-timestampoption.@evgeniiz321 commented on GitHub (Apr 22, 2025):
added tests specifically for
default-timestampand updated existing to passTimestamp. Seems working.