Repository navigation
quincy: pybind/mgr: disable sqlite3/python autocommit - #57199
Conversation
This avoids an assertion in ::drop_active. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 3fca118)
In the same epoch, to simplify testing. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit e044140)
Some are for development purposes and should be filtered out by the dashboard. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 0d94eeb) Conflicts: qa/tasks/mgr/dashboard/test_mgr_module.py: no leader_dashboard
To catch unintentional autocommit by sqlite3. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit fdd0dde)
Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 8ac4bbc)
Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 1749edd)
Refactor common tasks and allow loading mgrmodules before unittests start. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 2f48dc9)
These should have been part of the commit adding the tests. Fixes: 9ebcbdb Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 440f25e)
Otherwise you cannot use LocalDaemon.check_status. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 9748d0c)
This mirrors teuthology and makes it possible to check the exit status of a daemon. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit e2e2144) Conflicts: qa/tasks/vstart_runner.py: minor code diff
That autocommit is properly turned off and that commits via context managers work as expected. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit fb82b6d)
SQLite3 and python's binding were both committing transactions at unintended points. Turn it off and stop using executescript. Fixes: https://tracker.ceph.com/issues/65494 Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 6eacfe9)
|
jenkins test api |
|
@epuertat can you review this and decide if it should go in quincy? If so, add the "needs-qa" label. If it is a blocker, additionally change the milestone to "v17.2.8". |
It should go in v17.2.8. The bug can leave the sqlite3 database in a state the mgr doesn't know how to recover from. |
|
@phlogistonjohn mind reviewing this? |
phlogistonjohn
left a comment
There was a problem hiding this comment.
python bits (and teuthology bits) look ok for backport.
c++ bits are over my head :-)
|
My ceph-ceph-17.2.8 OBS packaging for Ubuntu 24.04 is broken with following error message: Once partly rollback with https://github.com/alvistack/ceph-ceph/blob/5ecb79fdfc03f2050b7472f86f4b1335132d6e27/debian/patches/0027-57199-revert-wip-65736-quincy.patch and recompile the packages, now error gone and running normally: |
this one is weird. My current theory is this is a quirk to an older version of sqlite3 I don't understand, specifically with how the database connection is opened ( |
I don't really think so, because I didn't patch the sqlite3 package but just using the official Ubuntu [sqlite3 (3.45.1-1ubuntu2)](24.04 https://packages.ubuntu.com/noble/sqlite3), which shouldn't be too old :-( P.S. Still, once this PR partly reverted, bug gone immediately :-( |
|
To me it looks like this is the normal behavior of Python's sqlite library. As documented in https://docs.python.org/3/library/sqlite3.html#transaction-control-via-the-autocommit-attribute, setting
>>> import sqlite3
>>> db = sqlite3.Connection(':memory:', autocommit=False)
>>> db.in_transaction
True
>>> c = db.cursor()
>>> c.execute('BEGIN;')
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
c.execute('BEGIN;')
~~~~~~~~~^^^^^^^^^^
sqlite3.OperationalError: cannot start a transaction within a transaction
>>>
>>> import sqlite3
>>> db = sqlite3.Connection(':memory:', autocommit=False)
>>> db.in_transaction
True
>>> db.commit()
>>> db.in_transaction
True
>>> db.commit()
>>> db.in_transaction
True
>>> import sqlite3
>>> db = sqlite3.Connection(':memory:', autocommit=True)
>>> db.in_transaction
False
>>> c = db.cursor()
>>> c.execute('BEGIN;')
<sqlite3.Cursor object at 0x7fb71453f7c0>
>>> db.in_transaction
True
>>> c.execute('COMMIT')
<sqlite3.Cursor object at 0x7fb71453f7c0>
>>> db.in_transaction
False
>>> |
|
Thanks to you both. I have opened https://tracker.ceph.com/issues/69912 |
backport tracker: https://tracker.ceph.com/issues/65736
backport of #56997
parent tracker: https://tracker.ceph.com/issues/65494
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh