Skip to content

crimson/osd: bring support for client blocklisting#47637

Merged
rzarzynski merged 3 commits intoceph:mainfrom
rzarzynski:wip-crimson-blocklist
May 2, 2023
Merged

crimson/osd: bring support for client blocklisting#47637
rzarzynski merged 3 commits intoceph:mainfrom
rzarzynski:wip-crimson-blocklist

Conversation

@rzarzynski
Copy link
Contributor

Contribution Guidelines

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

void PG::check_blocklisted_watchers()
{
logger().debug("{}", __func__);
shard_services.for_each_obc([this] (ObjectContextRef obc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to iterate over object contexts for other PGs as well. The PG needs a set of its own objects with live watches -- there shouldn't in general be all that many.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about skipping a watch on PG mismatch?

Copy link
Contributor

Choose a reason for hiding this comment

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

Iterating over all live object contexts on the shard to find the very small subset with a live watcher for this pg still strikes me as inefficient and complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. Perhaps we could flip the loops.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, we don't have a separate registry of watchers. The main difference with the classical is it uses a per-PG (not per-shard) registry of object contexts:

void PrimaryLogPG::check_blocklisted_watchers()
{
  dout(20) << "PrimaryLogPG::check_blocklisted_watchers for pg " << get_pgid() << dendl;
  pair<hobject_t, ObjectContextRef> i;
  while (object_contexts.get_next(i.first, &i))
    check_blocklisted_obc_watchers(i.second);
}

Duplicating the information looks even worse. HOWEVER:

  using lru_set_t = boost::intrusive::set<
    base_t,
    lru_set_option_t,
    boost::intrusive::key_of_value<VToKWrapped>
    >;
  lru_set_t lru_set;

Maybe, by changing the key derivation function, we could have OBCs sorted / prefixed by PG-derived part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we really need the per-shard aggregation of OBCs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not, tbh. We can just let each PG have its own.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rzarzynski rzarzynski force-pushed the wip-crimson-blocklist branch from f38adc7 to 845692a Compare August 19, 2022 17:09
@rzarzynski rzarzynski requested a review from athanatos August 19, 2022 17:09
@rzarzynski rzarzynski force-pushed the wip-crimson-blocklist branch from 845692a to fa61dbb Compare August 23, 2022 09:52
@rzarzynski rzarzynski requested a review from a team as a code owner August 23, 2022 09:52
@rzarzynski rzarzynski force-pushed the wip-crimson-blocklist branch from fa61dbb to a6f870f Compare August 23, 2022 10:02
@rzarzynski
Copy link
Contributor Author

jenkins retest this please

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@rzarzynski rzarzynski force-pushed the wip-crimson-blocklist branch 2 times, most recently from 211bbaf to 471b386 Compare October 7, 2022 18:23
@rzarzynski
Copy link
Contributor Author

@athanatos: would you mind another look?

@athanatos
Copy link
Contributor

Incidentally, if you re-request review it'll pop back up on my github query for PRs waiting on a review from me.

@Matan-B
Copy link
Contributor

Matan-B commented Nov 8, 2022

Ping

@athanatos
Copy link
Contributor

Looks like comments haven't been addressed?

@rzarzynski rzarzynski force-pushed the wip-crimson-blocklist branch from 471b386 to 08157f7 Compare January 11, 2023 19:15
@rzarzynski
Copy link
Contributor Author

rzarzynski commented Jan 11, 2023

The pushed revision addresses just the minors; the iteration thing requires further discussion.

rzarzynski added a commit to rzarzynski/ceph that referenced this pull request Jan 12, 2023
This patch moves the OBC registry from ShardServices (which
is basicaly a gateway to a bunch of PGs) into PG itself.
Dividing OBCs by PG (they truly belong to) minimizes the space
to search when e.g. checking whether a client is blocked or
not. Therefore, this commit is enabler of more performant
PR ceph#47637.

The changeset draws the assumption that OBC registry and all
its users live on the same CPU core. It looks valid to me.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Matan-B pushed a commit to Matan-B/ceph that referenced this pull request Feb 5, 2023
This patch moves the OBC registry from ShardServices (which
is basicaly a gateway to a bunch of PGs) into PG itself.
Dividing OBCs by PG (they truly belong to) minimizes the space
to search when e.g. checking whether a client is blocked or
not. Therefore, this commit is enabler of more performant
PR ceph#47637.

The changeset draws the assumption that OBC registry and all
its users live on the same CPU core. It looks valid to me.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Matan-B pushed a commit to Matan-B/ceph that referenced this pull request Feb 5, 2023
This patch moves the OBC registry from ShardServices (which
is basicaly a gateway to a bunch of PGs) into PG itself.
Dividing OBCs by PG (they truly belong to) minimizes the space
to search when e.g. checking whether a client is blocked or
not. Therefore, this commit is enabler of more performant
PR ceph#47637.

The changeset draws the assumption that OBC registry and all
its users live on the same CPU core. It looks valid to me.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
rzarzynski added a commit to rzarzynski/ceph that referenced this pull request Feb 7, 2023
This patch moves the OBC registry from ShardServices (which
is basicaly a gateway to a bunch of PGs) into PG itself.
Dividing OBCs by PG (they truly belong to) minimizes the space
to search when e.g. checking whether a client is blocked or
not. Therefore, this commit is enabler of more performant
PR ceph#47637.

The changeset draws the assumption that OBC registry and all
its users live on the same CPU core. It looks valid to me.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
rzarzynski added a commit to rzarzynski/ceph that referenced this pull request Feb 9, 2023
This patch moves the OBC registry from ShardServices (which
is basicaly a gateway to a bunch of PGs) into PG itself.
Dividing OBCs by PG (they truly belong to) minimizes the space
to search when e.g. checking whether a client is blocked or
not. Therefore, this commit is enabler of more performant
PR ceph#47637.

The changeset draws the assumption that OBC registry and all
its users live on the same CPU core. It looks valid to me.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@athanatos
Copy link
Contributor

I think we're waiting on tests here. A crimson-rados suite should suffice. Normally the change in common/ would require a rados suite, but testing infrastructure is backed up and the added method has no users in classic so there isn't any real risk.

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Matan-B
Copy link
Contributor

Matan-B commented Apr 2, 2023

@rzarzynski, Let's get this merged for rbd_lock_and_fence to pass in suite runs.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
`PG` directly aggregates both `OSDMap` and `PeeringState` which
maintains its own `OSDMap` instance. This duplication leads to
issues as the `PG::osdmap` never gets updated.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
@rzarzynski
Copy link
Contributor Author

@Matan-B: rebased. Let's finish this PR!

@rzarzynski
Copy link
Contributor Author

The following tests FAILED:
	  2 - setup-venv-for-mgr (Failed)
	  4 - run-tox-mgr (Not Run)
	 34 - run-rbd-unit-tests-127.sh (Timeout)

@rzarzynski
Copy link
Contributor Author

jenkins test make check

@Matan-B
Copy link
Contributor

Matan-B commented May 1, 2023

Once make check is up again, this PR can be merged based on:

https://pulpito.ceph.com/matan-2023-04-30_16:46:54-crimson-rados-wip-matanb-crimson-only-testing-30.4-distro-crimson-smithi/

@rzarzynski
Copy link
Contributor Author

The following tests FAILED:
	  2 - setup-venv-for-mgr (Failed)
	  4 - run-tox-mgr (Not Run)

@rzarzynski
Copy link
Contributor Author

jenkins test make check

1 similar comment
@Matan-B
Copy link
Contributor

Matan-B commented May 2, 2023

jenkins test make check

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.

3 participants