Browse Source

ref(hc): Adding organization member replication option (#57298)

Zach Collins 1 year ago
parent
commit
9264893945
2 changed files with 17 additions and 1 deletions
  1. 7 0
      src/sentry/hybridcloud/options.py
  2. 10 1
      tests/sentry/tasks/test_backfill_outboxes.py

+ 7 - 0
src/sentry/hybridcloud/options.py

@@ -1,6 +1,13 @@
 from sentry.options import FLAG_AUTOMATOR_MODIFIABLE, register
 from sentry.utils.types import Bool, Int
 
+register(
+    "outbox_replication.sentry_organizationmember.replication_version",
+    type=Int,
+    default=0,
+    flags=FLAG_AUTOMATOR_MODIFIABLE,
+)
+
 register(
     "outbox_replication.sentry_team.replication_version",
     type=Int,

+ 10 - 1
tests/sentry/tasks/test_backfill_outboxes.py

@@ -12,6 +12,7 @@ from sentry.models import (
     AuthProvider,
     AuthProviderReplica,
     ControlOutbox,
+    Organization,
     OrganizationMapping,
     RegionOutbox,
     outbox_context,
@@ -44,7 +45,7 @@ def reset_processing_state():
 
 
 @django_db_all
-@control_silo_test(stable=True)
+@no_silo_test(stable=True)
 def test_processing_awaits_options():
     reset_processing_state()
     org = Factories.create_organization()
@@ -59,6 +60,14 @@ def test_processing_awaits_options():
     ):
         assert backfill_outboxes_for(SiloMode.CONTROL, 0, 1)
 
+    assert not backfill_outboxes_for(SiloMode.REGION, 0, 1)
+    with override_options(
+        {
+            "outbox_replication.sentry_organization.replication_version": Organization.replication_version
+        }
+    ):
+        assert backfill_outboxes_for(SiloMode.REGION, 0, 1)
+
 
 @django_db_all
 @region_silo_test(stable=True)