[#305] Support checking if accessbox was removed #305

Merged
Member

Signed-off-by: Denis Kirillov d.kirillov@yadro.com

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
dkirillov self-assigned this 2024-02-06 13:45:57 +00:00
dkirillov changed title from WIP: [#XX] Support checking if accessbox was removed to WIP: [#305] Support checking if accessbox was removed 2024-02-06 13:46:06 +00:00
dkirillov force-pushed feature/checking_if_accessbox_is_removed_in_cache from 132a170594 to 685de91361 2024-02-06 13:47:25 +00:00 Compare
dkirillov changed title from WIP: [#305] Support checking if accessbox was removed to [#305] Support checking if accessbox was removed 2024-02-06 13:47:30 +00:00
dkirillov requested review from storage-services-committers 2024-02-06 13:47:37 +00:00
dkirillov requested review from storage-services-developers 2024-02-06 13:47:51 +00:00
alexvanin approved these changes 2024-02-08 15:45:05 +00:00
@ -103,1 +119,3 @@
return cachedBox, nil
cachedBoxValue := c.cache.Get(addr)
if cachedBoxValue != nil {
if time.Since(cachedBoxValue.PutTime) > c.removingCheckDuration {
Owner

suggestion (non-blocking): reversed condition reads a bit easier with less indent, I think.

	if cachedBoxValue != nil {
		if time.Since(cachedBoxValue.PutTime) <= c.removingCheckDuration {
			return cachedBoxValue.Box, nil
		}

		if box, err := c.getAccessBox(ctx, addr); err != nil {
			if client.IsErrObjectAlreadyRemoved(err) {
				c.cache.Delete(addr)
suggestion (non-blocking): reversed condition reads a bit easier with less indent, I think. ```go if cachedBoxValue != nil { if time.Since(cachedBoxValue.PutTime) <= c.removingCheckDuration { return cachedBoxValue.Box, nil } if box, err := c.getAccessBox(ctx, addr); err != nil { if client.IsErrObjectAlreadyRemoved(err) { c.cache.Delete(addr) ```
alexvanin marked this conversation as resolved
dkirillov force-pushed feature/checking_if_accessbox_is_removed_in_cache from 685de91361 to e129b214b0 2024-02-09 06:42:33 +00:00 Compare
dkirillov force-pushed feature/checking_if_accessbox_is_removed_in_cache from e129b214b0 to cc34f659d1 2024-02-09 06:44:39 +00:00 Compare
alexvanin merged commit cc34f659d1 into master 2024-02-09 08:15:11 +00:00
alexvanin deleted branch feature/checking_if_accessbox_is_removed_in_cache 2024-02-09 08:15:11 +00:00
alexvanin added this to the v0.29.0 milestone 2024-05-27 10:31:11 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
2 participants
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: TrueCloudLab/frostfs-s3-gw#305
No description provided.