Skip to content

tool: separating ceph-dedup-tool into tool and daemon #56067

Merged
yuriw merged 7 commits intoceph:mainfrom
myoungwon:wip-ceph-dedup-daemon
Apr 23, 2024
Merged

tool: separating ceph-dedup-tool into tool and daemon #56067
yuriw merged 7 commits intoceph:mainfrom
myoungwon:wip-ceph-dedup-daemon

Conversation

@myoungwon
Copy link
Member

@myoungwon myoungwon commented Mar 8, 2024

#53992

  • PR 1 : separating dedup tool and daemon (commit 1-3)

  • PR 2 : renaming and refactoring global variable

  • PR 3 : rework deduplication procedure in a async. manner

  • PR 4 : handling dedup-daemon's parameter and config + tests and subconscious bug fixes (commit 4-18)

  • PR 5 : Depending on the progress, integration to cephadm? or unittest framework (commit 19~)

Signed-off-by: Myoungwon Oh myoungwon.oh@samsung.com

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.

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

Copy link
Contributor

@athanatos athanatos left a comment

Choose a reason for hiding this comment

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

I stopped reviewing for now after the above comments. Before re-requesting review please do the following:

  1. Add a commit adding comment to every member or variable accessed in more than one thread // Accessed in the main thread and in the worker threads under <lock_name>
  2. Ensure that for every one of those variables, the same lock is held for all accesses -- both reads and writes.
  3. Ensure that there are as few of the above as possible

Also, do not complicate the locking structure by adding more locks or by adding shared-exclusive locks for now -- let's focus on getting the simple version correct first.

ceph::mutex glock = ceph::make_mutex("glock");
class SampleDedupWorkerThread;
std::list<SampleDedupWorkerThread> threads;
bool all_stop = false;
Copy link
Contributor

@athanatos athanatos Mar 8, 2024

Choose a reason for hiding this comment

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

Before moving onto your next work item, please submit a PR refactoring these globals into an automatic variable declared in main().

Copy link
Member Author

Choose a reason for hiding this comment

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

OK. I'll submit another PR to refactor the globals after this PR.

register_async_signal_handler_oneshot(SIGINT, handle_signal);
register_async_signal_handler_oneshot(SIGTERM, handle_signal);

int ret = make_crawling_daemon(opts);
Copy link
Contributor

Choose a reason for hiding this comment

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

Before your next work item, submit a PR renaming make_crawling_daemon to run_crawling_daemon.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK.

<< "Chunk Size : " << chunk_size << std::endl
<< std::endl;

while (!all_stop) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading all_stop here is undefined behavior as glock is not held.

cout << "new iteration" << std::endl;

ObjectCursor current_object = begin;
while (!stop && current_object < end) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading stop here is undefined behavior as m_lock is not held. In a larger sense -- why bother checking stop here and not all_stop? Why add m_lock/stop in addition to g_lock/all_stop?

…dedup_daemon

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
@myoungwon myoungwon force-pushed the wip-ceph-dedup-daemon branch from fd8f6aa to cc2856d Compare March 11, 2024 14:06
@myoungwon
Copy link
Member Author

myoungwon commented Mar 11, 2024

@athanatos Can you take a look at 4d903e1 and 8129d82 to see if I have addressed your comments?

…rrupt signal

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
Since the ceph-dedup-daemon exclusively uses set-chunk op,
dedup options in pool_info_t is not necessary.
These options are relevant only when handling tier-flush op.

Plus, this commit include the removal of unused code that is
no longer in use.

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
@myoungwon myoungwon force-pushed the wip-ceph-dedup-daemon branch from cc2856d to 31a98c2 Compare March 12, 2024 01:56
@myoungwon
Copy link
Member Author

I've made some extra changes to the updated commits to address your comments.

@athanatos
Copy link
Contributor

Can we drop "tool/ceph_dedup: rework deduplication procedure in the daemon" and introduce it in its own PR?

Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsung.com>
@myoungwon myoungwon force-pushed the wip-ceph-dedup-daemon branch from 31a98c2 to 5b06232 Compare March 14, 2024 05:33
@myoungwon
Copy link
Member Author

Can we drop "tool/ceph_dedup: rework deduplication procedure in the daemon" and introduce it in its own PR?

@athanatos OK. Done.

@athanatos
Copy link
Contributor

jenkins test signed

@athanatos athanatos self-requested a review March 14, 2024 17:21
Copy link
Contributor

@athanatos athanatos left a comment

Choose a reason for hiding this comment

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

Ok, lgtm once it goes through testing. Once this is scheduled for a run and the run completes, please confirm that the run includes your modified test and that the test passes. Ping me again once that happens and I'll take care of doing the merge.

This review identified 2-3 small changes that should be their own PRs, let's do those next (one at a time, please).

@ljflores
Copy link
Member

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants