Is object cache updated correctly during object removal? #178

Closed
opened 2025-12-28 17:36:31 +00:00 by sami · 1 comment
Owner

Originally created by @cthulhu-rider on GitHub (Mar 1, 2022).

Originally assigned to: @KirillovDenis on GitHub.

Here we update local object cache on object removal nspcc-dev/neofs-s3-gw@4454821285/api/layer/object.go (L413)

As we can see cache is updated regardless of call outcome. Is it correct? I haven't explored the behavior deeply, just happened to notice.

Originally created by @cthulhu-rider on GitHub (Mar 1, 2022). Originally assigned to: @KirillovDenis on GitHub. Here we update local object cache on object removal https://github.com/nspcc-dev/neofs-s3-gw/blob/44548212858db1d13a27c9b89cfe55041cde1e00/api/layer/object.go#L413 As we can see cache is updated regardless of call outcome. Is it correct? I haven't explored the behavior deeply, just happened to notice.
sami 2025-12-28 17:36:31 +00:00
Author
Owner

@alexvanin commented on GitHub (Mar 9, 2022):

Is it correct?

As we discussed it with @realloc @KirillovDenis @masterSplinter01 last Thursday, it is correct. It is better to remove existing value from cache than keep removed value there.

However I see some inconsistency in code, where cache value is removed based on success of NeoFS operation.

nspcc-dev/neofs-s3-gw@e7b742df4d/api/layer/system_object.go (L54-L60)

nspcc-dev/neofs-s3-gw@e7b742df4d/api/layer/layer.go (L893-L896)

@alexvanin commented on GitHub (Mar 9, 2022): > Is it correct? As we discussed it with @realloc @KirillovDenis @masterSplinter01 last Thursday, it is correct. It is better to remove existing value from cache than keep removed value there. However I see some inconsistency in code, where cache value is removed based on success of NeoFS operation. https://github.com/nspcc-dev/neofs-s3-gw/blob/e7b742df4d2c579344bda8b4bfb16baecf4fcf63/api/layer/system_object.go#L54-L60 https://github.com/nspcc-dev/neofs-s3-gw/blob/e7b742df4d2c579344bda8b4bfb16baecf4fcf63/api/layer/layer.go#L893-L896
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#178
No description provided.