Skip to content

pybind/mgr: disable sqlite3/python autocommit - #56997

Merged
batrick merged 12 commits into
ceph:mainfrom
batrick:i65494
Apr 30, 2024
Merged

batrick merged 12 commits into
ceph:mainfrom
batrick:i65494

Conversation

@batrick

@batrick batrick commented Apr 19, 2024 •

Copy link
Copy Markdown
Member

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Comment thread src/pybind/mgr/mgr_module.py Resolved
@batrick
batrick force-pushed the i65494 branch 2 times, most recently from 238ef88 to 0694828 Compare April 19, 2024 18:32
@batrick

batrick commented Apr 19, 2024

Copy link
Copy Markdown
Member Author

2024-04-19 14:45:17,824.824 INFO:__main__:----------------------------------------------------------------------
2024-04-19 14:45:17,824.824 INFO:__main__:Traceback (most recent call last):
2024-04-19 14:45:17,824.824 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/dashboard/helper.py", line 483, in assertSchema
2024-04-19 14:45:17,824.824 INFO:__main__:    return _validate_json(data, schema)
2024-04-19 14:45:17,824.824 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/dashboard/helper.py", line 710, in _validate_json
2024-04-19 14:45:17,825.825 INFO:__main__:    raise _ValError('unknown keys: {}'.format(unknown_keys), path)
2024-04-19 14:45:17,825.825 INFO:__main__:tasks.mgr.dashboard.helper._ValError: In `input`: unknown keys: {'sqlite3_killpoint'}
2024-04-19 14:45:17,825.825 INFO:__main__:
2024-04-19 14:45:17,825.825 INFO:__main__:During handling of the above exception, another exception occurred:
2024-04-19 14:45:17,825.825 INFO:__main__:
2024-04-19 14:45:17,825.825 INFO:__main__:Traceback (most recent call last):
2024-04-19 14:45:17,825.825 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/dashboard/test_mgr_module.py", line 123, in test_module_options
2024-04-19 14:45:17,825.825 INFO:__main__:    self.assertSchema(data, schema)
2024-04-19 14:45:17,825.825 INFO:__main__:  File "/home/jenkins-build/build/workspace/ceph-api/qa/tasks/mgr/dashboard/helper.py", line 485, in assertSchema
2024-04-19 14:45:17,825.825 INFO:__main__:    self.assertEqual(data, str(e))
2024-04-19 14:45:17,826.826 INFO:__main__:AssertionError: {'channel_basic': {'name': 'channel_basic[4897 chars] []}} != "In `input`: unknown keys: {'sqlite3_killpoint'}"
2024-04-19 14:45:17,826.826 INFO:__main__:
2024-04-19 14:45:17,826.826 INFO:__main__:> ip netns list
2024-04-19 14:45:17,830.830 INFO:__main__:> sudo ip link delete ceph-brx
Cannot find device "ceph-brx"
2024-04-19 14:45:17,845.845 INFO:__main__:
2024-04-19 14:45:17,845.845 INFO:__main__:----------------------------------------------------------------------
2024-04-19 14:45:17,845.845 INFO:__main__:

@epuertat rather than adding this module option which is for development, I'm wondering if it makes sense to have the dashboard filter out module options which are level "dev"? I've added a commit to allow setting the Option's level but I think adjustments need made to the dashboard. Any pointers?

@batrick

batrick commented Apr 20, 2024

Copy link
Copy Markdown
Member Author

@epuertat epuertat left a comment

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.

@batrick the failure, I guess, is related to this schema validation. You need to udpate that to reflect the new Option interface.

Comment thread src/pybind/mgr/mgr_module.py Resolved
@batrick
batrick force-pushed the i65494 branch 8 times, most recently from 0782bca to 1f44705 Compare April 24, 2024 17:37
@batrick
batrick requested a review from a team as a code owner April 24, 2024 17:37
@batrick
batrick requested review from aaSharma14 and removed request for a team April 24, 2024 17:37
@batrick
batrick requested a review from epuertat April 24, 2024 21:06
@batrick

batrick commented Apr 25, 2024

Copy link
Copy Markdown
Member Author

@epuertat epuertat left a comment

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.

LGTM!

Comment thread src/common/options.h
Comment on lines +119 to +127
static level_t str_to_level(std::string_view s) {
if (s == "basic") {
return LEVEL_BASIC;
} else if (s == "advanced") {
return LEVEL_ADVANCED;
} else if (s == "dev") {
return LEVEL_DEV;
} else {
return LEVEL_UNKNOWN;

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.

This is no longer needed, right?

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.

No, I left it in anyway.

batrick added 10 commits April 29, 2024 12:22
This avoids an assertion in ::drop_active.

Signed-off-by: Patrick Donnelly <[email protected]>
In the same epoch, to simplify testing.

Signed-off-by: Patrick Donnelly <[email protected]>
Some are for development purposes and should be filtered out by the dashboard.

Signed-off-by: Patrick Donnelly <[email protected]>
To catch unintentional autocommit by sqlite3.

Signed-off-by: Patrick Donnelly <[email protected]>
Signed-off-by: Patrick Donnelly <[email protected]>
Signed-off-by: Patrick Donnelly <[email protected]>
Refactor common tasks and allow loading mgrmodules before unittests start.

Signed-off-by: Patrick Donnelly <[email protected]>
These should have been part of the commit adding the tests.

Fixes: 9ebcbdb
Signed-off-by: Patrick Donnelly <[email protected]>
Otherwise you cannot use LocalDaemon.check_status.

Signed-off-by: Patrick Donnelly <[email protected]>
This mirrors teuthology and makes it possible to check the exit status of a
daemon.

Signed-off-by: Patrick Donnelly <[email protected]>
batrick added a commit to batrick/ceph that referenced this pull request Apr 29, 2024
* refs/pull/56997/head:
	pybind/mgr: disable sqlite3/python autocommit
	qa/tasks/mgr: add tests for sqlite autocommit
	qa/tasks/vstart_runner: run daemons in foreground
	qa/tasks/vstart_runner: add missing poll method
	qa/suites/rados/mgr: add cli/devicehealth tasks
	qa: reorganize mgr unit tests
	qa: use position-independent link
	qa: add missing terminating newline
	pybind/mgr: add killpoint for sqlite3 database setup
	mgr: allow specifying module option level
	mon/MgrMonitor: promote standby when unsetting down flag
	mon/MgrMonitor: only drop active if exists
batrick added 2 commits April 29, 2024 16:33
That autocommit is properly turned off and that commits via context managers
work as expected.

Signed-off-by: Patrick Donnelly <[email protected]>
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]>
@batrick

batrick commented Apr 29, 2024

Copy link
Copy Markdown
Member Author

@batrick

batrick commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

jenkins test make check

@batrick

batrick commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

jenkins test api

@batrick

batrick commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

jenkins test dashboard

@batrick

batrick commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

1 similar comment
@batrick

batrick commented Apr 30, 2024

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@hswong3i

Copy link
Copy Markdown
Contributor

Since this PR merged into ceph-ceph-17.2.8 but I face error as reported with #57199 (comment), but NOT affecting ceph-ceph-18.2.4 NOR ceph-ceph-19.2.0 (which not yet backport PR merged), doesn't that means something goes wrong for this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants