Project

General

Profile

Actions

Bug #82192

closed
KB

osd: an EC CALL op that runs again after an async read does its sync read on the handles of a finished coroutine

Bug #82192: osd: an EC CALL op that runs again after an async read does its sync read on the handles of a finished coroutine

Added by Kyle Bader about 1 month ago. Updated about 1 month ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
EC Pools
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

On a pool with EC optimizations, PrimaryLogPG::do_op() runs a CALL op in
a coroutine, so that a sync read in the class method (cls_cxx_read) can
yield. The op keeps the coroutine's handles in OpRequest::coro_handles.
The handles point into the coroutine's stack.

When an op of the request starts an async read, as a CHECKSUM before
the CALL does, the coroutine finishes before that read completes.
OpContext::finish_read() then runs the op again with execute_ctx(),
outside the coroutine. The CALL's read runs again, and its sync read
yields on the handles of the finished coroutine. Those handles point
into a stack that is gone, or that tracker #81777 leaks.

PrimaryLogPG::on_shutdown() also does not free a suspended coroutine
before the backend cancels its reads.

#81777 is the stack leak of a coroutine that completes without
yielding, the first bug of #79515. Its fix is
https://github.com/ceph/ceph/pull/72704, which does not fix the
handles, the run outside the coroutine, or the shutdown.

Fix

  • on_coroutine_complete() clears the handles of the op.
  • The coroutine waits for the async reads of the op, and runs the op
    again itself, where the sync read can yield.
  • on_shutdown() frees a suspended coroutine first.

The new unittest_ec_coroutines tests the stack and the handles. The
librados test LibRadosMiscECPP.ClassReadAfterAsyncRead runs a CHECKSUM
and then a CALL that reads the object.

Affected versions: main


Related issues 1 (0 open — 1 closed)

Is duplicate of RADOS - Bug #81777: osd: EC CALL op coroutine that completes without yielding leaks its stackBackportingMatty Williams

Actions

KB Updated by Kyle Bader about 1 month ago Actions #1

  • Pull request ID set to 73174

MW Updated by Matty Williams about 1 month ago Actions #2

  • Pull request ID deleted (73174)

MW Updated by Matty Williams about 1 month ago Actions #3

  • Is duplicate of Bug #81777: osd: EC CALL op coroutine that completes without yielding leaks its stack added

MW Updated by Matty Williams about 1 month ago Actions #4

  • Status changed from New to Duplicate
Actions

Also available in: PDF Atom