Skip to content

feat(hybridcloud): leave member-mapping user updates to the outbox drain - #132225

Draft
ldelvoye wants to merge 2 commits into
masterfrom
ldelvoye/feat/member-mapping-async-user-outbox
Draft

ldelvoye wants to merge 2 commits into
masterfrom
ldelvoye/feat/member-mapping-async-user-outbox

Conversation

@ldelvoye

Copy link
Copy Markdown
Member

resolves CTRL-109

Stops the member-mapping service from pushing a newly attached user's update out to the cells while it is still answering the cell's RPC; the scheduled outbox drain delivers it instead.

That inline push is the nested cell to control to cell round trip behind INC-2519, and it only fills user_email on the cell's member row. get_email() already falls back to control until the drain lands, which is seconds to about a minute.

Attaching a user to an org member mapping drained its user_update
outbox inline, inside the cell's RPC, which pushed back out to every
cell the user belongs to. The push only fills the member row's
user_email, and get_email() already falls back to control until then.
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

CTRL-109

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on bc8fa28 in this run:

tests/sentry/backup/test_exhaustive.py::ExhaustiveTests::test_exhaustive_dirty_pks — log
[gw3] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/backup/test_exhaustive.py:42: in test_exhaustive_dirty_pks
    actual = self.import_export_then_validate(self._testMethodName, reset_pks=False)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/testutils/helpers/backups.py:1070: in import_export_then_validate
    return import_export_then_validate(out_name, reset_pks=reset_pks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/sentry/testutils/helpers/backups.py:370: in import_export_then_validate
    raise ValidationError(res)
E   sentry.testutils.helpers.backups.ValidationError: ComparatorFinding(
E       kind: UnequalJSON,
E       on: InstanceID(model: 'sentry.organizationmember', ordinal: 2),
E       left_pk: 13,
E       right_pk: 2,
E       reason: 
E       --- 
E   
E       +++ 
E   
E       @@ -1,9 +1,9 @@
E   
E        {
E          "flags": "0",
E          "has_global_access": true,
E          "invite_status": 0,
E          "role": "member",
E          "type": 50,
E       -  "user_email": null,
E       +  "user_email": "member",
E          "user_is_active": true
E        }
E   )
E   ComparatorFinding(
E       kind: UnequalJSON,
E       on: InstanceID(model: 'sentry.organizationmember', ordinal: 9),
E       left_pk: 20,
E       right_pk: 9,
E       reason: 
E       --- 
E   
E       +++ 
E   
E       @@ -1,9 +1,9 @@
E   
E        {
E          "flags": "0",
E          "has_global_access": true,
E          "invite_status": 0,
E          "role": "member",
E          "type": 50,
... (51 more lines)
tests/sentry/backup/test_exports.py::FilteringTests::test_export_filter_orgs_multiple — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/backup/test_exports.py:694: in test_export_filter_orgs_multiple
    assert self.exists(data, OrganizationMember, "user_email", "added-by-org-owner")
E   AssertionError: assert False
E    +  where False = <function ExportTestCase.exists at 0xe70394f1b1a0>([{'model': 'sentry.organization', 'pk': 4559230680825888, 'fields': {'name': 'org-a', 'slug': 'org-a', 'status': 0, 'd... {'slug': 'project-org-c', 'name': 'project-org-c', 'forced_color': None, 'organization': 4559230680956960, ...}}, ...], OrganizationMember, 'user_email', 'added-by-org-owner')
E    +    where <function ExportTestCase.exists at 0xe70394f1b1a0> = <tests.sentry.backup.test_exports.FilteringTests testMethod=test_export_filter_orgs_multiple>.exists
tests/sentry/backup/test_exports.py::FilteringTests::test_export_filter_orgs_single — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/backup/test_exports.py:609: in test_export_filter_orgs_single
    assert self.exists(data, OrganizationMember, "user_email", "added-by-org-owner")
E   assert False
E    +  where False = <function ExportTestCase.exists at 0xe70394f1b1a0>([{'model': 'sentry.organization', 'pk': 4559230682136608, 'fields': {'name': 'org-b', 'slug': 'org-b', 'status': 0, 'd...'project': 4559230682202144, 'raw': '{"hello":"hello"}', 'schema': {'hello': 'hello'}, 'fallthrough': True, ...}}, ...], OrganizationMember, 'user_email', 'added-by-org-owner')
E    +    where <function ExportTestCase.exists at 0xe70394f1b1a0> = <tests.sentry.backup.test_exports.FilteringTests testMethod=test_export_filter_orgs_single>.exists
tests/sentry/notifications/utils/test_participants.py::GetSendToFallthroughTest::test_fallthrough_admin_or_recent_inactive_users — log
[gw3] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/notifications/utils/test_participants.py:900: in test_fallthrough_admin_or_recent_inactive_users
    self.assert_recipients_are(
tests/sentry/notifications/utils/test_participants.py:76: in assert_recipients_are
    assert actual == expected
E   AssertionError: assert defaultdict(<... slug=None)}}) == defaultdict(<... slug=None)}})
E     
E     Differing items:
E     �[0m{<ExternalProviders.EMAIL: �[94m100�[39;49;00m>: {Actor(�[96mid�[39;49;00m=�[94m252�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m), Actor(�[96mid�[39;49;00m=�[94m249�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m), Actor(�[96mid�[39;49;00m=�[94m253�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m), Actor(�[96mid�[39;49;00m=�[94m251�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m)}}�[90m�[39;49;00m != �[0m{<ExternalProviders.EMAIL: �[94m100�[39;49;00m>: {Actor(�[96mid�[39;49;00m=�[94m249�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m), Actor(�[96mid�[39;49;00m=�[94m251�[39;49;00m, actor_type=�[33m'�[39;49;00m�[33mUser�[39;49;00m�[33m'�[39;49;00m, slug=�[94mNone�[39;49;00m)}}�[90m�[39;49;00m
E     
E     Full diff:
E     �[0m�[90m �[39;49;00m defaultdict(<class 'set'>, {�[90m�[39;49;00m
E     �[90m �[39;49;00m     <ExternalProviders.EMAIL: 100>: {�[90m�[39;49;00m
E     �[92m+         Actor(id=253, actor_type='User', slug=None),�[39;49;00m�[90m�[39;49;00m
E     �[92m+         Actor(id=251, actor_type='User', slug=None),�[39;49;00m�[90m�[39;49;00m
E     �[92m+         Actor(id=252, actor_type='User', slug=None),�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m         Actor(id=249, actor_type='User', slug=None),�[90m�[39;49;00m
E     �[91m-         Actor(id=251, actor_type='User', slug=None),�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     },�[90m�[39;49;00m
E     �[90m �[39;49;00m })�[90m�[39;49;00m
tests/sentry/core/endpoints/test_organization_join_request.py::OrganizationJoinRequestTest::test_user_already_exists — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/core/endpoints/test_organization_join_request.py:82: in test_user_already_exists
    member = OrganizationMember.objects.get(organization=self.organization)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/django/db/models/manager.py:87: in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.13/site-packages/django/db/models/query.py:638: in get
    raise self.model.MultipleObjectsReturned(
E   sentry.models.organizationmember.OrganizationMember.MultipleObjectsReturned: get() returned more than one OrganizationMember -- it returned 2!
tests/sentry/integrations/vsts/test_integration.py::RegionVstsIntegrationTest::test_create_comment — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/vsts/test_integration.py:1012: in test_create_comment
    assert (
E   AssertionError: assert ' wrote:\n\n<...</blockquote>' == 'Sentry Admin...</blockquote>'
E     
E     �[0m�[91m- Sentry Admin wrote:�[39;49;00m�[90m�[39;49;00m
E     �[92m+  wrote:�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m �[90m�[39;49;00m
E     �[90m �[39;49;00m <blockquote>hello world�[90m�[39;49;00m
E     �[90m �[39;49;00m This is a comment.�[90m�[39;49;00m
E     �[90m �[39;49;00m �[90m�[39;49;00m
E     �[90m �[39;49;00m �[90m�[39;49;00m
E     �[90m �[39;49;00m     Glad it's quoted</blockquote>�[90m�[39;49;00m
tests/sentry/api/serializers/test_organization_member.py::OrganizationMemberWithProjectsSerializerTest::test_simple — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/serializers/test_organization_member.py:87: in test_simple
    assert [r["projects"] for r in result] == expected_projects
E   AssertionError: assert [['wealthy-cr...thy-cricket']] == [['champion-f...thy-cricket']]
E     
E     At index 0 diff: �[0m[�[33m'�[39;49;00m�[33mwealthy-cricket�[39;49;00m�[33m'�[39;49;00m]�[90m�[39;49;00m != �[0m[�[33m'�[39;49;00m�[33mchampion-fox�[39;49;00m�[33m'�[39;49;00m, �[33m'�[39;49;00m�[33mwealthy-cricket�[39;49;00m�[33m'�[39;49;00m]�[90m�[39;49;00m
E     
E     Full diff:
E     �[0m�[90m �[39;49;00m [�[90m�[39;49;00m
E     �[92m+     [�[39;49;00m�[90m�[39;49;00m
E     �[92m+         'wealthy-cricket',�[39;49;00m�[90m�[39;49;00m
E     �[92m+     ],�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     [�[90m�[39;49;00m
E     �[90m �[39;49;00m         'champion-fox',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'wealthy-cricket',�[90m�[39;49;00m
E     �[90m �[39;49;00m     ],�[90m�[39;49;00m
E     �[91m-     [�[39;49;00m�[90m�[39;49;00m
E     �[91m-         'wealthy-cricket',�[39;49;00m�[90m�[39;49;00m
E     �[91m-     ],�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m ]�[90m�[39;49;00m
tests/sentry/api/serializers/test_organization_member.py::OrganizationMemberWithTeamsSerializerTest::test_simple — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/serializers/test_organization_member.py:117: in test_simple
    assert [r["teams"] for r in result] == expected_teams
E   AssertionError: assert [['usable-gry...ued-lemming']] == [['usable-gry...ble-gryphon']]
E     
E     At index 0 diff: �[0m[�[33m'�[39;49;00m�[33musable-gryphon�[39;49;00m�[33m'�[39;49;00m]�[90m�[39;49;00m != �[0m[�[33m'�[39;49;00m�[33musable-gryphon�[39;49;00m�[33m'�[39;49;00m, �[33m'�[39;49;00m�[33mvalued-lemming�[39;49;00m�[33m'�[39;49;00m]�[90m�[39;49;00m
E     
E     Full diff:
E     �[0m�[90m �[39;49;00m [�[90m�[39;49;00m
E     �[92m+     [�[39;49;00m�[90m�[39;49;00m
E     �[92m+         'usable-gryphon',�[39;49;00m�[90m�[39;49;00m
E     �[92m+     ],�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m     [�[90m�[39;49;00m
E     �[90m �[39;49;00m         'usable-gryphon',�[90m�[39;49;00m
E     �[90m �[39;49;00m         'valued-lemming',�[90m�[39;49;00m
E     �[90m �[39;49;00m     ],�[90m�[39;49;00m
E     �[91m-     [�[39;49;00m�[90m�[39;49;00m
E     �[91m-         'usable-gryphon',�[39;49;00m�[90m�[39;49;00m
E     �[91m-     ],�[39;49;00m�[90m�[39;49;00m
E     �[90m �[39;49;00m ]�[90m�[39;49;00m

This branch has not been deployed

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

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant