Skip to content

Wip 4543 - #225

Merged
gregsfortytwo merged 4 commits into
nextfrom
wip-4543
Apr 22, 2013
Merged

gregsfortytwo merged 4 commits into
nextfrom
wip-4543

Conversation

@gregsfortytwo

Copy link
Copy Markdown
Member

Setting this up for Joao so we can preserve comments on the branch.

Comment thread src/mon/PaxosService.h Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to do this — it's an invitation to cross layer boundaries. In the case of this ticket that is precisely what we want to do in order to preserve the monmap, but I'd rather we came up with a more narrowly tailored way to do so. (Let me go through the rest of this and think for a bit about how we might do so.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So since our monmon() functions in fact do the type correction for us, I think we should just add a MonmapMonitor::get_newest_monmap() function, as it keeps the interface very clean and the exception quite narrow. (That was easier than I thought!)

@jecluis

jecluis commented Apr 22, 2013

Copy link
Copy Markdown
Member

Repushed a revised version. We now have a helper function on MonmapMonitor to obtain a monmap when we're backing up a monmap version during the store's sync init phase.

However, we are not able to use this when starting the monitor. We do cross some boundaries there, but we don't have a MonmapMonitor instance at that point, so we must access the store directly. Anyway, I moved those store accesses to a single 'obtain_monmap()' function, so it becomes clearer where it is happening.

@jecluis

jecluis commented Apr 22, 2013

Copy link
Copy Markdown
Member

Just found an issue with how we're attempting to backup the monmap (that can be triggered by the store having been cleared), and am now fixing it. This branch is not yet ready for merge.

@jecluis

jecluis commented Apr 22, 2013

Copy link
Copy Markdown
Member

Latest commit successfully fixes the issue I mentioned earlier.

Comment thread src/mon/Monitor.cc Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we really do want to error out on this (we probably do), it should be on a disk access error, not this generic one (since we are about to encode a monmap below!).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENOENT is the right error for this. I believe returning pretty much anything else would lead to a user misunderstanding what happened (assuming this is triggered).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the derr and assert output. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, misunderstanding what you meant doesn't even cover it. You're right, the error message is way to generic. I'll change that to something more terrifying like "something went wrong reading the store: " :)

@gregsfortytwo

Copy link
Copy Markdown
Member Author

And I forgot, but you should order the commits properly as right now it's using the monmap getter before the commit that implements it. That and the assert description change should set us up though if this is passing testing. :)

@jecluis

jecluis commented Apr 22, 2013

Copy link
Copy Markdown
Member

They look properly ordered locally:

19d4e39 mon: Monitor: backup current monmap if none is present on the store
937b5d3 ceph-mon: Attempt to obtain monmap from several possible sources
b4a31c2 mon: Monitor: backup monmap prior to starting a store sync
4b9a2a3 mon: MonmapMonitor: add function to obtain latest monmap
41b874c mon: PaxosService: add 'exists_key/version' helper functions

That is, aside from 19d4e39 which is to be squashed against b4a31c2. The ordering also appears to be wrong in at least one other branch, just can't figure out why.

@gregsfortytwo

Copy link
Copy Markdown
Member Author

Huh, looking at them here it's
mon: PaxosService: add 'exists_key/version' helper functions … 41b874c
mon: Monitor: backup monmap prior to starting a store sync … b4a31c2
mon: MonmapMonitor: add function to obtain latest monmap … 4b9a2a3
ceph-mon: Attempt to obtain monmap from several possible sources … 937b5d3
mon: Monitor: backup current monmap if none is present on the store … 19d4e39

Which is odd since they've got the same hashes....?

Joao Eduardo Luis added 2 commits April 22, 2013 22:53
If by fate we end up attempting a store sync after failing at
least one before, we might not have a monmap to read from the
store to backup.  Therefore, in that case, we shall backup the
current monmap being used by the monitor.

Signed-off-by: Joao Eduardo Luis <[email protected]>
In order of interest/priority:

  - our latest monmap version
  - a backup monmap version created during sync start, if the store
    appears to be in a post-aborted sync state
  - a mkfs monmap version

If none of these are found, we should go ahead and try to build a
monmap from ceph.conf to join an existing cluster.

Signed-off-by: Joao Eduardo Luis <[email protected]>
@jecluis

jecluis commented Apr 22, 2013

Copy link
Copy Markdown
Member

Looks like rebasing and force pushing fixed the history. :-)

gregsfortytwo added a commit that referenced this pull request Apr 22, 2013
@gregsfortytwo
gregsfortytwo merged commit c200cdb into next Apr 22, 2013
@gregsfortytwo
gregsfortytwo deleted the wip-4543 branch April 22, 2013 22:05
liewegas pushed a commit that referenced this pull request Dec 14, 2016
#7317 Tests for ENOSPC and OSD epoch barrier handling

Reviewed-by: Greg Farnum <[email protected]>
liewegas pushed a commit to liewegas/ceph that referenced this pull request Nov 5, 2021
jecluis pushed a commit to jecluis/ceph that referenced this pull request Oct 13, 2023
tchaikov added a commit that referenced this pull request May 5, 2026
When building with ASan, it reports leaks in five tests that exercise
CPython 3.10 either as an external process (bin/ceph) or embedded in
unittests:

   #36  smoke.sh                    (timeout, via bin/ceph)
  #205  unittest_mgr_pyformatter    (libpython3.10.so embedded)
  #206  unittest_mgr_pyutil         (libpython3.10.so embedded)
  #210  mgr-dashboard-smoke.sh      (via bin/ceph)
  #225  safe-to-destroy.sh          (via bin/ceph)

A representative stack from #210:

  Direct leak of 25846 byte(s) in 28 object(s) allocated from:
    #0  malloc
    #1  /usr/bin/python3.10+0x16d7be
  Direct leak of 20456 byte(s) in 29 object(s):
    #1  PyDict_Copy /usr/bin/python3.10+0x16ae06
  Direct leak of 8456 byte(s) in 14 object(s):
    #1  _PyObject_GC_NewVar /usr/bin/python3.10+0x14fc57

The unittests show the same shape against /lib/.../libpython3.10.so.

These are CPython 3.10 runtime artefacts, not Ceph bugs.  In CPython
3.10, Py_FinalizeEx() leaves a set of interpreter-internal allocations
(module namespace dict copies, GC-tracked variable-size containers,
type-method caches, interned strings) heap-allocated until process
exit; the OS reclaims them.  PEP 683 (Immortal Objects, accepted for
Python 3.12) extends pylifecycle.c::finalize_modules() to deallocate
these remaining objects during runtime shutdown:

  "During runtime shutdown, the strategy will be to first let the
  runtime try to do its best effort of deallocating these instances
  normally.  Most of the module deallocation will now be handled by
  pylifecycle.c:finalize_modules() where we clean up the remaining
  modules as best as we can."
                            -- PEP 683, https://peps.python.org/pep-0683/

The qa/lsan.supp file has carried the empirical note "python3.12
doesn't leak anything" since the file was introduced (commit
8c099a5, "asan: add qa/lsan.supp for leak sanitizer
suppressions", Mar 2023).  An empirical reproduction with a minimal
Py_Initialize()/Py_FinalizeEx() program built against Python 3.13
under -fsanitize=address reports zero leaks; the same minimal test
against Python 3.10 (CI environment) reports the leaks shown above.

Add three suppressions to qa/lsan.supp's existing 3.9-3.11 block:

 - leak:^PyDict_Copy and leak:^_PyObject_GC_NewVar match the two
   exported CPython functions visible in the leak stacks.
 - leak:python3.10 substring-matches the module path in the stack
   frame, catching unsymbolised offsets in both the /usr/bin/python3.10
   binary and the libpython3.10.so.1.0 shared object.  Mirrors the
   existing leak:libsqlite3.so pattern earlier in the file.

The whole block (including the existing PyMem_Malloc entry above) can
be removed once CI runs on Python >= 3.12.

Signed-off-by: Kefu Chai <[email protected]>
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.

2 participants