Skip to content

pool: make nearline request lifecycle transitions atomic - #8263

Open
kofemann wants to merge 1 commit into
12.0from
issue7511-12.0
Open

kofemann wants to merge 1 commit into
12.0from
issue7511-12.0

Conversation

@kofemann

Copy link
Copy Markdown
Member

Motivation:
The commit 4759b3f ("pool: don't scan flush/restore/remove queue to get stats") introduced lock-free nearline subsistem queue statistics to improve the queue query throughout. However, the change missed the case where queue state and stats must be updated atomically. Thus, tape pools under heavy load might run into double accounting when many requests are canceled of removed files have been in the flush queue.

Modification:
Introduce per-queue lock that takes care that queue statistics and request state update atomically. The getXxxQueueSize has no locks as stats are used in AtomicReference

Result:
Queue statistics can no longer go negative and pools no longer gets stuck.

Fixes: #7511
Acked-by: Lennart Sack
Target: master, 12.0, 11.2
Require-book: no
Require-notes: yes
(cherry picked from commit 1a362eb)

Motivation:
The commit 4759b3f ("pool: don't scan flush/restore/remove queue
to get stats") introduced lock-free nearline subsistem queue statistics
to improve the queue query throughout. However, the change missed the
case where queue state and stats must be updated atomically. Thus,
tape pools under heavy load might run into double accounting when many
requests are canceled of removed files have been in the flush queue.

Modification:
Introduce per-queue lock that takes care that queue statistics and request
state update atomically. The getXxxQueueSize has no locks as stats are
used in AtomicReference

Result:
Queue statistics can no longer go negative and pools no longer gets
stuck.

Fixes: #7511
Acked-by: Lennart Sack
Target: master, 12.0, 11.2
Require-book: no
Require-notes: yes
(cherry picked from commit 1a362eb)
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
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.

1 participant