Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(personhog): tombstone person deletes on request and report the versions written (#93853)

Nick Best27562a6b4df7
diff --git a/nodejs/src/common/generated/personhog/personhog/types/v1/person_pb.ts b/nodejs/src/common/generated/personhog/personhog/types/v1/person_pb.ts
index 746a11dc94d2..baf4baa76dd4 100644
--- a/nodejs/src/common/generated/personhog/personhog/types/v1/person_pb.ts
+++ b/nodejs/src/common/generated/personhog/personhog/types/v1/person_pb.ts
@@ -13,7 +13,7 @@ import { file_personhog_types_v1_common } from './common_pb'
export const file_personhog_types_v1_person: GenFile =
/*@__PURE__*/
fileDesc(
- 'Ch9wZXJzb25ob2cvdHlwZXMvdjEvcGVyc29uLnByb3RvEhJwZXJzb25ob2cudHlwZXMudjEisgIKBlBlcnNvbhIKCgJpZBgBIAEoAxIMCgR1dWlkGAIgASgJEg8KB3RlYW1faWQYAyABKAMSEgoKcHJvcGVydGllcxgEIAEoDBIiChpwcm9wZXJ0aWVzX2xhc3RfdXBkYXRlZF9hdBgFIAEoDBIhChlwcm9wZXJ0aWVzX2xhc3Rfb3BlcmF0aW9uGAYgASgMEhIKCmNyZWF0ZWRfYXQYByABKAMSDwoHdmVyc2lvbhgIIAEoAxIVCg1pc19pZGVudGlmaWVkGAkgASgIEhcKCmlzX3VzZXJfaWQYCiABKAhIAIgBARIZCgxsYXN0X3NlZW5fYXQYCyABKANIAYgBARISCgppc19kZWxldGVkGAwgASgIQg0KC19pc191c2VyX2lkQg8KDV9sYXN0X3NlZW5fYXQiZgoVRGlzdGluY3RJZFdpdGhWZXJzaW9uEhMKC2Rpc3RpbmN0X2lkGAEgASgJEhQKB3ZlcnNpb24YAiABKANIAIgBARIPCgJpZBgDIAEoA0gBiAEBQgoKCF92ZXJzaW9uQgUKA19pZCJoChVQZXJzb25XaXRo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MKH0RFTEVURV9QRVJTT05TX01PREVfVU5TUEVDSUZJRUQQABIcChhERUxFVEVfUEVSU09OU19NT0RFX0hBUkQQARIhCh1ERUxFVEVfUEVSU09OU19NT0RFX1RPTUJTVE9ORRACKm8KD0xpZmVjeWNsZU9wVHlwZRIhCh1MSUZFQ1lDTEVfT1BfVFlQRV9VTlNQRUNJRklFRBAAEhwKGExJRkVDWUNMRV9PUF9UWVBFX0RFTEVURRABEhsKF0xJRkVDWUNMRV9PUF9UWVBFX01FUkdFEAIqbQoOUmVsZWFzZU91dGNvbWUSHwobUkVMRUFTRV9PVVRDT01FX1VOU1BFQ0lGSUVEEAASHQoZUkVMRUFTRV9PVVRDT01FX0NPTU1JVFRFRBABEhsKF1JFTEVBU0VfT1VUQ09NRV9BQk9SVEVEEAJiBnByb3RvMw',
[file_personhog_types_v1_common]
)
@@ -728,9 +728,9 @@ export const UpdatePersonPropertiesResponseSchema: GenMessage<UpdatePersonProper
messageDesc(file_personhog_types_v1_person, 21)
/**
- * DeletePersonsRequest deletes persons from Postgres by UUID.
- * Also deletes associated posthog_persondistinctid rows (FK is NO ACTION).
- * posthog_featureflaghashkeyoverride rows cascade automatically at the DB level.
+ * DeletePersonsRequest deletes persons from Postgres by UUID, together with
+ * their posthog_persondistinctid, posthog_cohortpeople and
+ * posthog_featureflaghashkeyoverride rows (nothing cascades them).
*
* @generated from message personhog.types.v1.DeletePersonsRequest
*/
@@ -746,6 +746,11 @@ export type DeletePersonsRequest = Message<'personhog.types.v1.DeletePersonsRequ
* @generated from field: repeated string person_uuids = 2;
*/
personUuids: string[]
+
+ /**
+ * @generated from field: personhog.types.v1.DeletePersonsMode mode = 3;
+ */
+ mode: DeletePersonsMode
}
/**
@@ -756,6 +761,57 @@ export const DeletePersonsRequestSchema: GenMessage<DeletePersonsRequest> =
/*@__PURE__*/
messageDesc(file_personhog_types_v1_person, 22)
+/**
+ * @generated from message personhog.types.v1.TombstonedDistinctId
+ */
+export type TombstonedDistinctId = Message<'personhog.types.v1.TombstonedDistinctId'> & {
+ /**
+ * @generated from field: string distinct_id = 1;
+ */
+ distinctId: string
+
+ /**
+ * @generated from field: int64 version = 2;
+ */
+ version: bigint
+}
+
+/**
+ * Describes the message personhog.types.v1.TombstonedDistinctId.
+ * Use `create(TombstonedDistinctIdSchema)` to create a new message.
+ */
+export const TombstonedDistinctIdSchema: GenMessage<TombstonedDistinctId> =
+ /*@__PURE__*/
+ messageDesc(file_personhog_types_v1_person, 23)
+
+/**
+ * @generated from message personhog.types.v1.TombstonedPerson
+ */
+export type TombstonedPerson = Message<'personhog.types.v1.TombstonedPerson'> & {
+ /**
+ * @generated from field: string person_uuid = 1;
+ */
+ personUuid: string
+
+ /**
+ * @generated from field: int64 version = 2;
+ */
+ version: bigint
+
+ /**
+ * @generated from field: repeated personhog.types.v1.TombstonedDistinctId distinct_ids = 3;
+ */
+ distinctIds: TombstonedDistinctId[]
+}
+
+/**
+ * Describes the message personhog.types.v1.TombstonedPerson.
+ * Use `create(TombstonedPersonSchema)` to create a new message.
+ */
+export const TombstonedPersonSchema: GenMessage<TombstonedPerson> =
+ /*@__PURE__*/
+ messageDesc(file_personhog_types_v1_person, 24)
+
/**
* @generated from message personhog.types.v1.DeletePersonsResponse
*/
@@ -764,6 +820,25 @@ export type DeletePersonsResponse = Message<'personhog.types.v1.DeletePersonsRes
* @generated from field: int64 deleted_count = 1;
*/
deletedCount: bigint
+
+ /**
+ * True when the rows were tombstoned rather than removed.
+ *
+ * @generated from field: bool tombstoned = 2;
+ */
+ tombstoned: boolean
+
+ /**
+ * One entry per requested person that is tombstoned after the call, with the
+ * versions its rows hold, so the caller can publish its ClickHouse tombstones
+ * at exactly those versions. Persons tombstoned before the call are included
+ * too, so a retry after a lost response gets the same versions again;
+ * deleted_count counts only the rows this call tombstoned. Empty on a hard
+ * delete.
+ *
+ * @generated from field: repeated personhog.types.v1.TombstonedPerson tombstones = 3;
+ */
+ tombstones: TombstonedPerson[]
}
/**
@@ -772,7 +847,7 @@ export type DeletePersonsResponse = Message<'personhog.types.v1.DeletePersonsRes
*/
export const DeletePersonsResponseSchema: GenMessage<DeletePersonsResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 23)
+ messageDesc(file_personhog_types_v1_person, 25)
/**
* DeletePersonsBatchForTeamRequest deletes up to batch_size persons for a team.
@@ -802,7 +877,7 @@ export type DeletePersonsBatchForTeamRequest = Message<'personhog.types.v1.Delet
*/
export const DeletePersonsBatchForTeamRequestSchema: GenMessage<DeletePersonsBatchForTeamRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 24)
+ messageDesc(file_personhog_types_v1_person, 26)
/**
* @generated from message personhog.types.v1.DeletePersonsBatchForTeamResponse
@@ -822,7 +897,7 @@ export type DeletePersonsBatchForTeamResponse = Message<'personhog.types.v1.Dele
*/
export const DeletePersonsBatchForTeamResponseSchema: GenMessage<DeletePersonsBatchForTeamResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 25)
+ messageDesc(file_personhog_types_v1_person, 27)
/**
* DeleteTombstonedPersonsRequest deletes persons only while they are still
@@ -864,7 +939,7 @@ export type DeleteTombstonedPersonsRequest = Message<'personhog.types.v1.DeleteT
*/
export const DeleteTombstonedPersonsRequestSchema: GenMessage<DeleteTombstonedPersonsRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 26)
+ messageDesc(file_personhog_types_v1_person, 28)
/**
* @generated from message personhog.types.v1.DeleteTombstonedPersonsResponse
@@ -915,7 +990,7 @@ export type DeleteTombstonedPersonsResponse = Message<'personhog.types.v1.Delete
*/
export const DeleteTombstonedPersonsResponseSchema: GenMessage<DeleteTombstonedPersonsResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 27)
+ messageDesc(file_personhog_types_v1_person, 29)
/**
* SplitPersonRequest splits specific distinct_ids off of a person onto new persons.
@@ -953,7 +1028,7 @@ export type SplitPersonRequest = Message<'personhog.types.v1.SplitPersonRequest'
*/
export const SplitPersonRequestSchema: GenMessage<SplitPersonRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 28)
+ messageDesc(file_personhog_types_v1_person, 30)
/**
* SplitResult describes a single distinct_id that was split onto a new person.
@@ -995,7 +1070,7 @@ export type SplitResult = Message<'personhog.types.v1.SplitResult'> & {
* Describes the message personhog.types.v1.SplitResult.
* Use `create(SplitResultSchema)` to create a new message.
*/
-export const SplitResultSchema: GenMessage<SplitResult> = /*@__PURE__*/ messageDesc(file_personhog_types_v1_person, 29)
+export const SplitResultSchema: GenMessage<SplitResult> = /*@__PURE__*/ messageDesc(file_personhog_types_v1_person, 31)
/**
* @generated from message personhog.types.v1.SplitPersonResponse
@@ -1015,7 +1090,7 @@ export type SplitPersonResponse = Message<'personhog.types.v1.SplitPersonRespons
*/
export const SplitPersonResponseSchema: GenMessage<SplitPersonResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 30)
+ messageDesc(file_personhog_types_v1_person, 32)
/**
* SetPersonDistinctIdVersionFloorRequest bumps a person_distinct_id row's version.
@@ -1052,7 +1127,7 @@ export type SetPersonDistinctIdVersionFloorRequest =
*/
export const SetPersonDistinctIdVersionFloorRequestSchema: GenMessage<SetPersonDistinctIdVersionFloorRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 31)
+ messageDesc(file_personhog_types_v1_person, 33)
/**
* @generated from message personhog.types.v1.SetPersonDistinctIdVersionFloorResponse
@@ -1075,7 +1150,7 @@ export type SetPersonDistinctIdVersionFloorResponse =
*/
export const SetPersonDistinctIdVersionFloorResponseSchema: GenMessage<SetPersonDistinctIdVersionFloorResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 32)
+ messageDesc(file_personhog_types_v1_person, 34)
/**
* SetPersonVersionFloorRequest bumps a person's version. Used by the undelete repair
@@ -1110,7 +1185,7 @@ export type SetPersonVersionFloorRequest = Message<'personhog.types.v1.SetPerson
*/
export const SetPersonVersionFloorRequestSchema: GenMessage<SetPersonVersionFloorRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 33)
+ messageDesc(file_personhog_types_v1_person, 35)
/**
* @generated from message personhog.types.v1.SetPersonVersionFloorResponse
@@ -1130,7 +1205,7 @@ export type SetPersonVersionFloorResponse = Message<'personhog.types.v1.SetPerso
*/
export const SetPersonVersionFloorResponseSchema: GenMessage<SetPersonVersionFloorResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 34)
+ messageDesc(file_personhog_types_v1_person, 36)
/**
* FencePersonRequest freezes a person for a lifecycle operation (see
@@ -1167,7 +1242,7 @@ export type FencePersonRequest = Message<'personhog.types.v1.FencePersonRequest'
*/
export const FencePersonRequestSchema: GenMessage<FencePersonRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 35)
+ messageDesc(file_personhog_types_v1_person, 37)
/**
* @generated from message personhog.types.v1.FencePersonResponse
@@ -1196,7 +1271,7 @@ export type FencePersonResponse = Message<'personhog.types.v1.FencePersonRespons
*/
export const FencePersonResponseSchema: GenMessage<FencePersonResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 36)
+ messageDesc(file_personhog_types_v1_person, 38)
/**
* FencePersonsRequest freezes many persons of one op in one call (see
@@ -1233,7 +1308,7 @@ export type FencePersonsRequest = Message<'personhog.types.v1.FencePersonsReques
*/
export const FencePersonsRequestSchema: GenMessage<FencePersonsRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 37)
+ messageDesc(file_personhog_types_v1_person, 39)
/**
* Every requested person id lands in exactly one of the two lists; a
@@ -1267,7 +1342,7 @@ export type FencePersonsResponse = Message<'personhog.types.v1.FencePersonsRespo
*/
export const FencePersonsResponseSchema: GenMessage<FencePersonsResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 38)
+ messageDesc(file_personhog_types_v1_person, 40)
/**
* @generated from message personhog.types.v1.FencedPersonSeal
@@ -1300,7 +1375,7 @@ export type FencedPersonSeal = Message<'personhog.types.v1.FencedPersonSeal'> &
*/
export const FencedPersonSealSchema: GenMessage<FencedPersonSeal> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 39)
+ messageDesc(file_personhog_types_v1_person, 41)
/**
* ReleaseFenceRequest closes a fence (see PersonHogLeader.ReleaseFence).
@@ -1368,7 +1443,7 @@ export type ReleaseFenceRequest = Message<'personhog.types.v1.ReleaseFenceReques
*/
export const ReleaseFenceRequestSchema: GenMessage<ReleaseFenceRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 40)
+ messageDesc(file_personhog_types_v1_person, 42)
/**
* @generated from message personhog.types.v1.ReleaseFenceResponse
@@ -1381,7 +1456,7 @@ export type ReleaseFenceResponse = Message<'personhog.types.v1.ReleaseFenceRespo
*/
export const ReleaseFenceResponseSchema: GenMessage<ReleaseFenceResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 41)
+ messageDesc(file_personhog_types_v1_person, 43)
/**
* ReleaseFencesRequest closes many fences of one op in one call (see
@@ -1418,7 +1493,7 @@ export type ReleaseFencesRequest = Message<'personhog.types.v1.ReleaseFencesRequ
*/
export const ReleaseFencesRequestSchema: GenMessage<ReleaseFencesRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 42)
+ messageDesc(file_personhog_types_v1_person, 44)
/**
* @generated from message personhog.types.v1.ReleaseFenceItem
@@ -1455,7 +1530,7 @@ export type ReleaseFenceItem = Message<'personhog.types.v1.ReleaseFenceItem'> &
*/
export const ReleaseFenceItemSchema: GenMessage<ReleaseFenceItem> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 43)
+ messageDesc(file_personhog_types_v1_person, 45)
/**
* @generated from message personhog.types.v1.ReleaseFencesResponse
@@ -1468,7 +1543,7 @@ export type ReleaseFencesResponse = Message<'personhog.types.v1.ReleaseFencesRes
*/
export const ReleaseFencesResponseSchema: GenMessage<ReleaseFencesResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 44)
+ messageDesc(file_personhog_types_v1_person, 46)
/**
* A sealed source snapshot paired with its precedence ordinal — the
@@ -1496,7 +1571,7 @@ export type SealedSourceSnapshot = Message<'personhog.types.v1.SealedSourceSnaps
*/
export const SealedSourceSnapshotSchema: GenMessage<SealedSourceSnapshot> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 45)
+ messageDesc(file_personhog_types_v1_person, 47)
/**
* FoldPersonDocumentRequest folds sealed source snapshots into the merge
@@ -1572,7 +1647,7 @@ export type FoldPersonDocumentRequest = Message<'personhog.types.v1.FoldPersonDo
*/
export const FoldPersonDocumentRequestSchema: GenMessage<FoldPersonDocumentRequest> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 46)
+ messageDesc(file_personhog_types_v1_person, 48)
/**
* @generated from message personhog.types.v1.FoldPersonDocumentResponse
@@ -1600,7 +1675,44 @@ export type FoldPersonDocumentResponse = Message<'personhog.types.v1.FoldPersonD
*/
export const FoldPersonDocumentResponseSchema: GenMessage<FoldPersonDocumentResponse> =
/*@__PURE__*/
- messageDesc(file_personhog_types_v1_person, 47)
+ messageDesc(file_personhog_types_v1_person, 49)
+
+/**
+ * How DeletePersons removes the rows.
+ *
+ * @generated from enum personhog.types.v1.DeletePersonsMode
+ */
+export enum DeletePersonsMode {
+ /**
+ * Same as HARD.
+ *
+ * @generated from enum value: DELETE_PERSONS_MODE_UNSPECIFIED = 0;
+ */
+ UNSPECIFIED = 0,
+
+ /**
+ * Remove the rows, tombstoned ones included. For callers that publish no
+ * ClickHouse tombstones and want nothing left behind, such as a purge.
+ *
+ * @generated from enum value: DELETE_PERSONS_MODE_HARD = 1;
+ */
+ HARD = 1,
+
+ /**
+ * Keep the rows as tombstones and report the versions written. The caller
+ * owns the prerequisite: ingestion must revive tombstones for the team.
+ *
+ * @generated from enum value: DELETE_PERSONS_MODE_TOMBSTONE = 2;
+ */
+ TOMBSTONE = 2,
+}
+
+/**
+ * Describes the enum personhog.types.v1.DeletePersonsMode.
+ */
+export const DeletePersonsModeSchema: GenEnum<DeletePersonsMode> =
+ /*@__PURE__*/
+ enumDesc(file_personhog_types_v1_person, 0)
/**
* The kind of lifecycle operation — mirrors lifecycle_op.op_type. The
@@ -1629,7 +1741,7 @@ export enum LifecycleOpType {
/**
* Describes the enum personhog.types.v1.LifecycleOpType.
*/
-export const LifecycleOpTypeSchema: GenEnum<LifecycleOpType> = /*@__PURE__*/ enumDesc(file_personhog_types_v1_person, 0)
+export const LifecycleOpTypeSchema: GenEnum<LifecycleOpType> = /*@__PURE__*/ enumDesc(file_personhog_types_v1_person, 1)
/**
* @generated from enum personhog.types.v1.ReleaseOutcome
@@ -1658,4 +1770,4 @@ export enum ReleaseOutcome {
/**
* Describes the enum personhog.types.v1.ReleaseOutcome.
*/
-export const ReleaseOutcomeSchema: GenEnum<ReleaseOutcome> = /*@__PURE__*/ enumDesc(file_personhog_types_v1_person, 1)
+export const ReleaseOutcomeSchema: GenEnum<ReleaseOutcome> = /*@__PURE__*/ enumDesc(file_personhog_types_v1_person, 2)
diff --git a/packages/personhog-proto/personhog/types/v1/person_pb2.py b/packages/personhog-proto/personhog/types/v1/person_pb2.py
index 675eaaf539db..a4ef65534dfc 100644
--- a/packages/personhog-proto/personhog/types/v1/person_pb2.py
+++ b/packages/personhog-proto/personhog/types/v1/person_pb2.py
@@ -23,7 +23,7 @@ _sym_db = _symbol_database.Default()
from personhog.types.v1 import common_pb2 as personhog_dot_types_dot_v1_dot_common__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
- b'\n\x1fpersonhog/types/v1/person.proto\x12\x12personhog.types.v1\x1a\x1fpersonhog/types/v1/common.proto"\xb2\x02\n\x06Person\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x0f\n\x07team_id\x18\x03 \x01(\x03\x12\x12\n\nproperties\x18\x04 \x01(\x0c\x12"\n\x1aproperties_last_updated_at\x18\x05 \x01(\x0c\x12!\n\x19properties_last_operation\x18\x06 \x01(\x0c\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x12\x0f\n\x07version\x18\x08 \x01(\x03\x12\x15\n\ris_identified\x18\t \x01(\x08\x12\x17\n\nis_user_id\x18\n \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0clast_seen_at\x18\x0b \x01(\x03H\x01\x88\x01\x01\x12\x12\n\nis_deleted\x18\x0c \x01(\x08\x42\r\n\x0b_is_user_idB\x0f\n\r_last_seen_at"f\n\x15\x44istinctIdWithVersion\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12\x14\n\x07version\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x03 \x01(\x03H\x01\x88\x01\x01\x42\n\n\x08_versionB\x05\n\x03_id"h\n\x15PersonWithDistinctIds\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12/\n\x06person\x18\x02 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"g\n\x11PersonDistinctIds\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12?\n\x0c\x64istinct_ids\x18\x02 \x03(\x0b\x32).personhog.types.v1.DistinctIdWithVersion"\x87\x01\n\x18PersonWithTeamDistinctId\x12/\n\x03key\x18\x01 \x01(\x0b\x32".personhog.types.v1.TeamDistinctId\x12/\n\x06person\x18\x02 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"m\n\x10GetPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"O\n\x11GetPersonResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"o\n\x11GetPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nperson_ids\x18\x02 \x03(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"S\n\x0fPersonsResponse\x12+\n\x07persons\x18\x01 \x03(\x0b\x32\x1a.personhog.types.v1.Person\x12\x13\n\x0bmissing_ids\x18\x02 \x03(\x03"n\n\x16GetPersonByUuidRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"q\n\x18GetPersonsByUuidsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05uuids\x18\x02 \x03(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"{\n\x1cGetPersonByDistinctIdRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x13\n\x0b\x64istinct_id\x18\x02 \x01(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"\x84\x01\n$GetPersonsByDistinctIdsInTeamRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0c\x64istinct_ids\x18\x02 \x03(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"`\n"PersonsByDistinctIdsInTeamResponse\x12:\n\x07results\x18\x01 \x03(\x0b\x32).personhog.types.v1.PersonWithDistinctIds"\x96\x01\n\x1eGetPersonsByDistinctIdsRequest\x12=\n\x11team_distinct_ids\x18\x01 \x03(\x0b\x32".personhog.types.v1.TeamDistinctId\x12\x35\n\x0cread_options\x18\x02 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"]\n\x1cPersonsByDistinctIdsResponse\x12=\n\x07results\x18\x01 \x03(\x0b\x32,.personhog.types.v1.PersonWithTeamDistinctId"\xbf\x01\n\x1eGetDistinctIdsForPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions\x12\x12\n\x05limit\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12\x16\n\tcursor_id\x18\x05 \x01(\x03H\x01\x88\x01\x01\x42\x08\n\x06_limitB\x0c\n\n_cursor_id"\x92\x01\n\x1fGetDistinctIdsForPersonResponse\x12?\n\x0c\x64istinct_ids\x18\x01 \x03(\x0b\x32).personhog.types.v1.DistinctIdWithVersion\x12\x1b\n\x0enext_cursor_id\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x11\n\x0f_next_cursor_id"\xb1\x01\n\x1fGetDistinctIdsForPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nperson_ids\x18\x02 \x03(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions\x12\x1d\n\x10limit_per_person\x18\x04 \x01(\x03H\x00\x88\x01\x01\x42\x13\n\x11_limit_per_person"f\n GetDistinctIdsForPersonsResponse\x12\x42\n\x13person_distinct_ids\x18\x01 \x03(\x0b\x32%.personhog.types.v1.PersonDistinctIds"\x96\x02\n\x1dUpdatePersonPropertiesRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x12\n\nevent_name\x18\x03 \x01(\t\x12\x16\n\x0eset_properties\x18\x04 \x01(\x0c\x12\x1b\n\x13set_once_properties\x18\x05 \x01(\x0c\x12\x18\n\x10unset_properties\x18\x06 \x03(\t\x12\x1a\n\ris_identified\x18\x07 \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0clast_seen_at\x18\x08 \x01(\x03H\x01\x88\x01\x01\x12\x14\n\x0c\x66orce_update\x18\t \x01(\x08\x42\x10\n\x0e_is_identifiedB\x0f\n\r_last_seen_at"m\n\x1eUpdatePersonPropertiesResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x12\x0f\n\x07updated\x18\x02 \x01(\x08\x42\t\n\x07_person"=\n\x14\x44\x65letePersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0cperson_uuids\x18\x02 \x03(\t".\n\x15\x44\x65letePersonsResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03"G\n DeletePersonsBatchForTeamRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nbatch_size\x18\x02 \x01(\x03":\n!DeletePersonsBatchForTeamResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03"Y\n\x1e\x44\x65leteTombstonedPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0cperson_uuids\x18\x02 \x03(\t\x12\x10\n\x08max_rows\x18\x03 \x01(\x03"\xa6\x01\n\x1f\x44\x65leteTombstonedPersonsResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03\x12\x1a\n\x12skipped_live_count\x18\x02 \x01(\x03\x12\x1c\n\x14\x62locked_person_uuids\x18\x03 \x03(\t\x12\x1c\n\x14pending_person_uuids\x18\x04 \x03(\t\x12\x14\n\x0crows_deleted\x18\x05 \x01(\x03"W\n\x12SplitPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x1d\n\x15\x64istinct_ids_to_split\x18\x03 \x03(\t"\x8e\x01\n\x0bSplitResult\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12\x17\n\x0fnew_person_uuid\x18\x02 \x01(\t\x12\x1a\n\x12new_person_version\x18\x03 \x01(\x03\x12\x13\n\x0bpdi_version\x18\x04 \x01(\x03\x12 \n\x18new_person_created_at_ms\x18\x05 \x01(\x03"F\n\x13SplitPersonResponse\x12/\n\x06splits\x18\x01 \x03(\x0b\x32\x1f.personhog.types.v1.SplitResult"c\n&SetPersonDistinctIdVersionFloorRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x13\n\x0b\x64istinct_id\x18\x02 \x01(\t\x12\x13\n\x0bmin_version\x18\x03 \x01(\x03"e\n\'SetPersonDistinctIdVersionFloorResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"W\n\x1cSetPersonVersionFloorRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x13\n\x0bmin_version\x18\x03 \x01(\x03"0\n\x1dSetPersonVersionFloorResponse\x12\x0f\n\x07updated\x18\x01 \x01(\x08"}\n\x12\x46\x65ncePersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\r\n\x05op_id\x18\x03 \x01(\t\x12\x34\n\x07op_type\x18\x04 \x01(\x0e\x32#.personhog.types.v1.LifecycleOpType"A\n\x13\x46\x65ncePersonResponse\x12*\n\x06sealed\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person"\x7f\n\x13\x46\x65ncePersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05op_id\x18\x02 \x01(\t\x12\x34\n\x07op_type\x18\x03 \x01(\x0e\x32#.personhog.types.v1.LifecycleOpType\x12\x12\n\nperson_ids\x18\x04 \x03(\x03"_\n\x14\x46\x65ncePersonsResponse\x12\x34\n\x06sealed\x18\x01 \x03(\x0b\x32$.personhog.types.v1.FencedPersonSeal\x12\x11\n\tnot_found\x18\x02 \x03(\x03"J\n\x10\x46\x65ncedPersonSeal\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12\x12\n\ncreated_at\x18\x03 \x01(\x03"\xd6\x01\n\x13ReleaseFenceRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x13\n\x0bperson_uuid\x18\x03 \x01(\t\x12\r\n\x05op_id\x18\x04 \x01(\t\x12\x33\n\x07outcome\x18\x05 \x01(\x0e\x32".personhog.types.v1.ReleaseOutcome\x12\x1b\n\x0esealed_version\x18\x06 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x42\x11\n\x0f_sealed_version"\x16\n\x14ReleaseFenceResponse"\xa2\x01\n\x14ReleaseFencesRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05op_id\x18\x02 \x01(\t\x12\x33\n\x07outcome\x18\x03 \x01(\x0e\x32".personhog.types.v1.ReleaseOutcome\x12\x35\n\x07persons\x18\x04 \x03(\x0b\x32$.personhog.types.v1.ReleaseFenceItem"~\n\x10ReleaseFenceItem\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x13\n\x0bperson_uuid\x18\x02 \x01(\t\x12\x1b\n\x0esealed_version\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x42\x11\n\x0f_sealed_version"\x17\n\x15ReleaseFencesResponse"S\n\x14SealedSourceSnapshot\x12*\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person\x12\x0f\n\x07ordinal\x18\x02 \x01(\x05"\xbd\x01\n\x19\x46oldPersonDocumentRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x42\n\x10sealed_snapshots\x18\x03 \x03(\x0b\x32(.personhog.types.v1.SealedSourceSnapshot\x12\x11\n\tevent_set\x18\x04 \x01(\x0c\x12\x16\n\x0e\x65vent_set_once\x18\x05 \x01(\x0c\x12\r\n\x05op_id\x18\x06 \x01(\t"H\n\x1a\x46oldPersonDocumentResponse\x12*\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person*o\n\x0fLifecycleOpType\x12!\n\x1dLIFECYCLE_OP_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18LIFECYCLE_OP_TYPE_DELETE\x10\x01\x12\x1b\n\x17LIFECYCLE_OP_TYPE_MERGE\x10\x02*m\n\x0eReleaseOutcome\x12\x1f\n\x1bRELEASE_OUTCOME_UNSPECIFIED\x10\x00\x12\x1d\n\x19RELEASE_OUTCOME_COMMITTED\x10\x01\x12\x1b\n\x17RELEASE_OUTCOME_ABORTED\x10\x02\x62\x06proto3'
+ b'\n\x1fpersonhog/types/v1/person.proto\x12\x12personhog.types.v1\x1a\x1fpersonhog/types/v1/common.proto"\xb2\x02\n\x06Person\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x0f\n\x07team_id\x18\x03 \x01(\x03\x12\x12\n\nproperties\x18\x04 \x01(\x0c\x12"\n\x1aproperties_last_updated_at\x18\x05 \x01(\x0c\x12!\n\x19properties_last_operation\x18\x06 \x01(\x0c\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x12\x0f\n\x07version\x18\x08 \x01(\x03\x12\x15\n\ris_identified\x18\t \x01(\x08\x12\x17\n\nis_user_id\x18\n \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0clast_seen_at\x18\x0b \x01(\x03H\x01\x88\x01\x01\x12\x12\n\nis_deleted\x18\x0c \x01(\x08\x42\r\n\x0b_is_user_idB\x0f\n\r_last_seen_at"f\n\x15\x44istinctIdWithVersion\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12\x14\n\x07version\x18\x02 \x01(\x03H\x00\x88\x01\x01\x12\x0f\n\x02id\x18\x03 \x01(\x03H\x01\x88\x01\x01\x42\n\n\x08_versionB\x05\n\x03_id"h\n\x15PersonWithDistinctIds\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12/\n\x06person\x18\x02 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"g\n\x11PersonDistinctIds\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12?\n\x0c\x64istinct_ids\x18\x02 \x03(\x0b\x32).personhog.types.v1.DistinctIdWithVersion"\x87\x01\n\x18PersonWithTeamDistinctId\x12/\n\x03key\x18\x01 \x01(\x0b\x32".personhog.types.v1.TeamDistinctId\x12/\n\x06person\x18\x02 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"m\n\x10GetPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"O\n\x11GetPersonResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"o\n\x11GetPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nperson_ids\x18\x02 \x03(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"S\n\x0fPersonsResponse\x12+\n\x07persons\x18\x01 \x03(\x0b\x32\x1a.personhog.types.v1.Person\x12\x13\n\x0bmissing_ids\x18\x02 \x03(\x03"n\n\x16GetPersonByUuidRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x0c\n\x04uuid\x18\x02 \x01(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"q\n\x18GetPersonsByUuidsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05uuids\x18\x02 \x03(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"{\n\x1cGetPersonByDistinctIdRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x13\n\x0b\x64istinct_id\x18\x02 \x01(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"\x84\x01\n$GetPersonsByDistinctIdsInTeamRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0c\x64istinct_ids\x18\x02 \x03(\t\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"`\n"PersonsByDistinctIdsInTeamResponse\x12:\n\x07results\x18\x01 \x03(\x0b\x32).personhog.types.v1.PersonWithDistinctIds"\x96\x01\n\x1eGetPersonsByDistinctIdsRequest\x12=\n\x11team_distinct_ids\x18\x01 \x03(\x0b\x32".personhog.types.v1.TeamDistinctId\x12\x35\n\x0cread_options\x18\x02 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions"]\n\x1cPersonsByDistinctIdsResponse\x12=\n\x07results\x18\x01 \x03(\x0b\x32,.personhog.types.v1.PersonWithTeamDistinctId"\xbf\x01\n\x1eGetDistinctIdsForPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions\x12\x12\n\x05limit\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12\x16\n\tcursor_id\x18\x05 \x01(\x03H\x01\x88\x01\x01\x42\x08\n\x06_limitB\x0c\n\n_cursor_id"\x92\x01\n\x1fGetDistinctIdsForPersonResponse\x12?\n\x0c\x64istinct_ids\x18\x01 \x03(\x0b\x32).personhog.types.v1.DistinctIdWithVersion\x12\x1b\n\x0enext_cursor_id\x18\x02 \x01(\x03H\x00\x88\x01\x01\x42\x11\n\x0f_next_cursor_id"\xb1\x01\n\x1fGetDistinctIdsForPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nperson_ids\x18\x02 \x03(\x03\x12\x35\n\x0cread_options\x18\x03 \x01(\x0b\x32\x1f.personhog.types.v1.ReadOptions\x12\x1d\n\x10limit_per_person\x18\x04 \x01(\x03H\x00\x88\x01\x01\x42\x13\n\x11_limit_per_person"f\n GetDistinctIdsForPersonsResponse\x12\x42\n\x13person_distinct_ids\x18\x01 \x03(\x0b\x32%.personhog.types.v1.PersonDistinctIds"\x96\x02\n\x1dUpdatePersonPropertiesRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x12\n\nevent_name\x18\x03 \x01(\t\x12\x16\n\x0eset_properties\x18\x04 \x01(\x0c\x12\x1b\n\x13set_once_properties\x18\x05 \x01(\x0c\x12\x18\n\x10unset_properties\x18\x06 \x03(\t\x12\x1a\n\ris_identified\x18\x07 \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0clast_seen_at\x18\x08 \x01(\x03H\x01\x88\x01\x01\x12\x14\n\x0c\x66orce_update\x18\t \x01(\x08\x42\x10\n\x0e_is_identifiedB\x0f\n\r_last_seen_at"m\n\x1eUpdatePersonPropertiesResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x12\x0f\n\x07updated\x18\x02 \x01(\x08\x42\t\n\x07_person"r\n\x14\x44\x65letePersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0cperson_uuids\x18\x02 \x03(\t\x12\x33\n\x04mode\x18\x03 \x01(\x0e\x32%.personhog.types.v1.DeletePersonsMode"<\n\x14TombstonedDistinctId\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03"x\n\x10TombstonedPerson\x12\x13\n\x0bperson_uuid\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12>\n\x0c\x64istinct_ids\x18\x03 \x03(\x0b\x32(.personhog.types.v1.TombstonedDistinctId"|\n\x15\x44\x65letePersonsResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03\x12\x12\n\ntombstoned\x18\x02 \x01(\x08\x12\x38\n\ntombstones\x18\x03 \x03(\x0b\x32$.personhog.types.v1.TombstonedPerson"G\n DeletePersonsBatchForTeamRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x12\n\nbatch_size\x18\x02 \x01(\x03":\n!DeletePersonsBatchForTeamResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03"Y\n\x1e\x44\x65leteTombstonedPersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x14\n\x0cperson_uuids\x18\x02 \x03(\t\x12\x10\n\x08max_rows\x18\x03 \x01(\x03"\xa6\x01\n\x1f\x44\x65leteTombstonedPersonsResponse\x12\x15\n\rdeleted_count\x18\x01 \x01(\x03\x12\x1a\n\x12skipped_live_count\x18\x02 \x01(\x03\x12\x1c\n\x14\x62locked_person_uuids\x18\x03 \x03(\t\x12\x1c\n\x14pending_person_uuids\x18\x04 \x03(\t\x12\x14\n\x0crows_deleted\x18\x05 \x01(\x03"W\n\x12SplitPersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x1d\n\x15\x64istinct_ids_to_split\x18\x03 \x03(\t"\x8e\x01\n\x0bSplitResult\x12\x13\n\x0b\x64istinct_id\x18\x01 \x01(\t\x12\x17\n\x0fnew_person_uuid\x18\x02 \x01(\t\x12\x1a\n\x12new_person_version\x18\x03 \x01(\x03\x12\x13\n\x0bpdi_version\x18\x04 \x01(\x03\x12 \n\x18new_person_created_at_ms\x18\x05 \x01(\x03"F\n\x13SplitPersonResponse\x12/\n\x06splits\x18\x01 \x03(\x0b\x32\x1f.personhog.types.v1.SplitResult"c\n&SetPersonDistinctIdVersionFloorRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x13\n\x0b\x64istinct_id\x18\x02 \x01(\t\x12\x13\n\x0bmin_version\x18\x03 \x01(\x03"e\n\'SetPersonDistinctIdVersionFloorResponse\x12/\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.PersonH\x00\x88\x01\x01\x42\t\n\x07_person"W\n\x1cSetPersonVersionFloorRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x13\n\x0bmin_version\x18\x03 \x01(\x03"0\n\x1dSetPersonVersionFloorResponse\x12\x0f\n\x07updated\x18\x01 \x01(\x08"}\n\x12\x46\x65ncePersonRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\r\n\x05op_id\x18\x03 \x01(\t\x12\x34\n\x07op_type\x18\x04 \x01(\x0e\x32#.personhog.types.v1.LifecycleOpType"A\n\x13\x46\x65ncePersonResponse\x12*\n\x06sealed\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person"\x7f\n\x13\x46\x65ncePersonsRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05op_id\x18\x02 \x01(\t\x12\x34\n\x07op_type\x18\x03 \x01(\x0e\x32#.personhog.types.v1.LifecycleOpType\x12\x12\n\nperson_ids\x18\x04 \x03(\x03"_\n\x14\x46\x65ncePersonsResponse\x12\x34\n\x06sealed\x18\x01 \x03(\x0b\x32$.personhog.types.v1.FencedPersonSeal\x12\x11\n\tnot_found\x18\x02 \x03(\x03"J\n\x10\x46\x65ncedPersonSeal\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12\x12\n\ncreated_at\x18\x03 \x01(\x03"\xd6\x01\n\x13ReleaseFenceRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x13\n\x0bperson_uuid\x18\x03 \x01(\t\x12\r\n\x05op_id\x18\x04 \x01(\t\x12\x33\n\x07outcome\x18\x05 \x01(\x0e\x32".personhog.types.v1.ReleaseOutcome\x12\x1b\n\x0esealed_version\x18\x06 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x42\x11\n\x0f_sealed_version"\x16\n\x14ReleaseFenceResponse"\xa2\x01\n\x14ReleaseFencesRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\r\n\x05op_id\x18\x02 \x01(\t\x12\x33\n\x07outcome\x18\x03 \x01(\x0e\x32".personhog.types.v1.ReleaseOutcome\x12\x35\n\x07persons\x18\x04 \x03(\x0b\x32$.personhog.types.v1.ReleaseFenceItem"~\n\x10ReleaseFenceItem\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x13\n\x0bperson_uuid\x18\x02 \x01(\t\x12\x1b\n\x0esealed_version\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x03\x42\x11\n\x0f_sealed_version"\x17\n\x15ReleaseFencesResponse"S\n\x14SealedSourceSnapshot\x12*\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person\x12\x0f\n\x07ordinal\x18\x02 \x01(\x05"\xbd\x01\n\x19\x46oldPersonDocumentRequest\x12\x0f\n\x07team_id\x18\x01 \x01(\x03\x12\x11\n\tperson_id\x18\x02 \x01(\x03\x12\x42\n\x10sealed_snapshots\x18\x03 \x03(\x0b\x32(.personhog.types.v1.SealedSourceSnapshot\x12\x11\n\tevent_set\x18\x04 \x01(\x0c\x12\x16\n\x0e\x65vent_set_once\x18\x05 \x01(\x0c\x12\r\n\x05op_id\x18\x06 \x01(\t"H\n\x1a\x46oldPersonDocumentResponse\x12*\n\x06person\x18\x01 \x01(\x0b\x32\x1a.personhog.types.v1.Person*y\n\x11\x44\x65letePersonsMode\x12#\n\x1f\x44\x45LETE_PERSONS_MODE_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x44\x45LETE_PERSONS_MODE_HARD\x10\x01\x12!\n\x1d\x44\x45LETE_PERSONS_MODE_TOMBSTONE\x10\x02*o\n\x0fLifecycleOpType\x12!\n\x1dLIFECYCLE_OP_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18LIFECYCLE_OP_TYPE_DELETE\x10\x01\x12\x1b\n\x17LIFECYCLE_OP_TYPE_MERGE\x10\x02*m\n\x0eReleaseOutcome\x12\x1f\n\x1bRELEASE_OUTCOME_UNSPECIFIED\x10\x00\x12\x1d\n\x19RELEASE_OUTCOME_COMMITTED\x10\x01\x12\x1b\n\x17RELEASE_OUTCOME_ABORTED\x10\x02\x62\x06proto3'
)
_globals = globals()
@@ -31,10 +31,12 @@ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "personhog.types.v1.person_pb2", _globals)
if not _descriptor._USE_C_DESCRIPTORS:
DESCRIPTOR._loaded_options = None
- _globals["_LIFECYCLEOPTYPE"]._serialized_start = 5651
- _globals["_LIFECYCLEOPTYPE"]._serialized_end = 5762
- _globals["_RELEASEOUTCOME"]._serialized_start = 5764
- _globals["_RELEASEOUTCOME"]._serialized_end = 5873
+ _globals["_DELETEPERSONSMODE"]._serialized_start = 5966
+ _globals["_DELETEPERSONSMODE"]._serialized_end = 6087
+ _globals["_LIFECYCLEOPTYPE"]._serialized_start = 6089
+ _globals["_LIFECYCLEOPTYPE"]._serialized_end = 6200
+ _globals["_RELEASEOUTCOME"]._serialized_start = 6202
+ _globals["_RELEASEOUTCOME"]._serialized_end = 6311
_globals["_PERSON"]._serialized_start = 89
_globals["_PERSON"]._serialized_end = 395
_globals["_DISTINCTIDWITHVERSION"]._serialized_start = 397
@@ -80,55 +82,59 @@ if not _descriptor._USE_C_DESCRIPTORS:
_globals["_UPDATEPERSONPROPERTIESRESPONSE"]._serialized_start = 2981
_globals["_UPDATEPERSONPROPERTIESRESPONSE"]._serialized_end = 3090
_globals["_DELETEPERSONSREQUEST"]._serialized_start = 3092
- _globals["_DELETEPERSONSREQUEST"]._serialized_end = 3153
- _globals["_DELETEPERSONSRESPONSE"]._serialized_start = 3155
- _globals["_DELETEPERSONSRESPONSE"]._serialized_end = 3201
- _globals["_DELETEPERSONSBATCHFORTEAMREQUEST"]._serialized_start = 3203
- _globals["_DELETEPERSONSBATCHFORTEAMREQUEST"]._serialized_end = 3274
- _globals["_DELETEPERSONSBATCHFORTEAMRESPONSE"]._serialized_start = 3276
- _globals["_DELETEPERSONSBATCHFORTEAMRESPONSE"]._serialized_end = 3334
- _globals["_DELETETOMBSTONEDPERSONSREQUEST"]._serialized_start = 3336
- _globals["_DELETETOMBSTONEDPERSONSREQUEST"]._serialized_end = 3425
- _globals["_DELETETOMBSTONEDPERSONSRESPONSE"]._serialized_start = 3428
- _globals["_DELETETOMBSTONEDPERSONSRESPONSE"]._serialized_end = 3594
- _globals["_SPLITPERSONREQUEST"]._serialized_start = 3596
- _globals["_SPLITPERSONREQUEST"]._serialized_end = 3683
- _globals["_SPLITRESULT"]._serialized_start = 3686
- _globals["_SPLITRESULT"]._serialized_end = 3828
- _globals["_SPLITPERSONRESPONSE"]._serialized_start = 3830
- _globals["_SPLITPERSONRESPONSE"]._serialized_end = 3900
- _globals["_SETPERSONDISTINCTIDVERSIONFLOORREQUEST"]._serialized_start = 3902
- _globals["_SETPERSONDISTINCTIDVERSIONFLOORREQUEST"]._serialized_end = 4001
- _globals["_SETPERSONDISTINCTIDVERSIONFLOORRESPONSE"]._serialized_start = 4003
- _globals["_SETPERSONDISTINCTIDVERSIONFLOORRESPONSE"]._serialized_end = 4104
- _globals["_SETPERSONVERSIONFLOORREQUEST"]._serialized_start = 4106
- _globals["_SETPERSONVERSIONFLOORREQUEST"]._serialized_end = 4193
- _globals["_SETPERSONVERSIONFLOORRESPONSE"]._serialized_start = 4195
- _globals["_SETPERSONVERSIONFLOORRESPONSE"]._serialized_end = 4243
- _globals["_FENCEPERSONREQUEST"]._serialized_start = 4245
- _globals["_FENCEPERSONREQUEST"]._serialized_end = 4370
- _globals["_FENCEPERSONRESPONSE"]._serialized_start = 4372
- _globals["_FENCEPERSONRESPONSE"]._serialized_end = 4437
- _globals["_FENCEPERSONSREQUEST"]._serialized_start = 4439
- _globals["_FENCEPERSONSREQUEST"]._serialized_end = 4566
- _globals["_FENCEPERSONSRESPONSE"]._serialized_start = 4568
- _globals["_FENCEPERSONSRESPONSE"]._serialized_end = 4663
- _globals["_FENCEDPERSONSEAL"]._serialized_start = 4665
- _globals["_FENCEDPERSONSEAL"]._serialized_end = 4739
- _globals["_RELEASEFENCEREQUEST"]._serialized_start = 4742
- _globals["_RELEASEFENCEREQUEST"]._serialized_end = 4956
- _globals["_RELEASEFENCERESPONSE"]._serialized_start = 4958
- _globals["_RELEASEFENCERESPONSE"]._serialized_end = 4980
- _globals["_RELEASEFENCESREQUEST"]._serialized_start = 4983
- _globals["_RELEASEFENCESREQUEST"]._serialized_end = 5145
- _globals["_RELEASEFENCEITEM"]._serialized_start = 5147
- _globals["_RELEASEFENCEITEM"]._serialized_end = 5273
- _globals["_RELEASEFENCESRESPONSE"]._serialized_start = 5275
- _globals["_RELEASEFENCESRESPONSE"]._serialized_end = 5298
- _globals["_SEALEDSOURCESNAPSHOT"]._serialized_start = 5300
- _globals["_SEALEDSOURCESNAPSHOT"]._serialized_end = 5383
- _globals["_FOLDPERSONDOCUMENTREQUEST"]._serialized_start = 5386
- _globals["_FOLDPERSONDOCUMENTREQUEST"]._serialized_end = 5575
- _globals["_FOLDPERSONDOCUMENTRESPONSE"]._serialized_start = 5577
- _globals["_FOLDPERSONDOCUMENTRESPONSE"]._serialized_end = 5649
+ _globals["_DELETEPERSONSREQUEST"]._serialized_end = 3206
+ _globals["_TOMBSTONEDDISTINCTID"]._serialized_start = 3208
+ _globals["_TOMBSTONEDDISTINCTID"]._serialized_end = 3268
+ _globals["_TOMBSTONEDPERSON"]._serialized_start = 3270
+ _globals["_TOMBSTONEDPERSON"]._serialized_end = 3390
+ _globals["_DELETEPERSONSRESPONSE"]._serialized_start = 3392
+ _globals["_DELETEPERSONSRESPONSE"]._serialized_end = 3516
+ _globals["_DELETEPERSONSBATCHFORTEAMREQUEST"]._serialized_start = 3518
+ _globals["_DELETEPERSONSBATCHFORTEAMREQUEST"]._serialized_end = 3589
+ _globals["_DELETEPERSONSBATCHFORTEAMRESPONSE"]._serialized_start = 3591
+ _globals["_DELETEPERSONSBATCHFORTEAMRESPONSE"]._serialized_end = 3649
+ _globals["_DELETETOMBSTONEDPERSONSREQUEST"]._serialized_start = 3651
+ _globals["_DELETETOMBSTONEDPERSONSREQUEST"]._serialized_end = 3740
+ _globals["_DELETETOMBSTONEDPERSONSRESPONSE"]._serialized_start = 3743
+ _globals["_DELETETOMBSTONEDPERSONSRESPONSE"]._serialized_end = 3909
+ _globals["_SPLITPERSONREQUEST"]._serialized_start = 3911
+ _globals["_SPLITPERSONREQUEST"]._serialized_end = 3998
+ _globals["_SPLITRESULT"]._serialized_start = 4001
+ _globals["_SPLITRESULT"]._serialized_end = 4143
+ _globals["_SPLITPERSONRESPONSE"]._serialized_start = 4145
+ _globals["_SPLITPERSONRESPONSE"]._serialized_end = 4215
+ _globals["_SETPERSONDISTINCTIDVERSIONFLOORREQUEST"]._serialized_start = 4217
+ _globals["_SETPERSONDISTINCTIDVERSIONFLOORREQUEST"]._serialized_end = 4316
+ _globals["_SETPERSONDISTINCTIDVERSIONFLOORRESPONSE"]._serialized_start = 4318
+ _globals["_SETPERSONDISTINCTIDVERSIONFLOORRESPONSE"]._serialized_end = 4419
+ _globals["_SETPERSONVERSIONFLOORREQUEST"]._serialized_start = 4421
+ _globals["_SETPERSONVERSIONFLOORREQUEST"]._serialized_end = 4508
+ _globals["_SETPERSONVERSIONFLOORRESPONSE"]._serialized_start = 4510
+ _globals["_SETPERSONVERSIONFLOORRESPONSE"]._serialized_end = 4558
+ _globals["_FENCEPERSONREQUEST"]._serialized_start = 4560
+ _globals["_FENCEPERSONREQUEST"]._serialized_end = 4685
+ _globals["_FENCEPERSONRESPONSE"]._serialized_start = 4687
+ _globals["_FENCEPERSONRESPONSE"]._serialized_end = 4752
+ _globals["_FENCEPERSONSREQUEST"]._serialized_start = 4754
+ _globals["_FENCEPERSONSREQUEST"]._serialized_end = 4881
+ _globals["_FENCEPERSONSRESPONSE"]._serialized_start = 4883
+ _globals["_FENCEPERSONSRESPONSE"]._serialized_end = 4978
+ _globals["_FENCEDPERSONSEAL"]._serialized_start = 4980
+ _globals["_FENCEDPERSONSEAL"]._serialized_end = 5054
+ _globals["_RELEASEFENCEREQUEST"]._serialized_start = 5057
+ _globals["_RELEASEFENCEREQUEST"]._serialized_end = 5271
+ _globals["_RELEASEFENCERESPONSE"]._serialized_start = 5273
+ _globals["_RELEASEFENCERESPONSE"]._serialized_end = 5295
+ _globals["_RELEASEFENCESREQUEST"]._serialized_start = 5298
+ _globals["_RELEASEFENCESREQUEST"]._serialized_end = 5460
+ _globals["_RELEASEFENCEITEM"]._serialized_start = 5462
+ _globals["_RELEASEFENCEITEM"]._serialized_end = 5588
+ _globals["_RELEASEFENCESRESPONSE"]._serialized_start = 5590
+ _globals["_RELEASEFENCESRESPONSE"]._serialized_end = 5613
+ _globals["_SEALEDSOURCESNAPSHOT"]._serialized_start = 5615
+ _globals["_SEALEDSOURCESNAPSHOT"]._serialized_end = 5698
+ _globals["_FOLDPERSONDOCUMENTREQUEST"]._serialized_start = 5701
+ _globals["_FOLDPERSONDOCUMENTREQUEST"]._serialized_end = 5890
+ _globals["_FOLDPERSONDOCUMENTRESPONSE"]._serialized_start = 5892
+ _globals["_FOLDPERSONDOCUMENTRESPONSE"]._serialized_end = 5964
# @@protoc_insertion_point(module_scope)
diff --git a/packages/personhog-proto/personhog/types/v1/person_pb2.pyi b/packages/personhog-proto/personhog/types/v1/person_pb2.pyi
index b78f1ddaa490..67bb9fba970a 100644
--- a/packages/personhog-proto/personhog/types/v1/person_pb2.pyi
+++ b/packages/personhog-proto/personhog/types/v1/person_pb2.pyi
@@ -21,6 +21,12 @@ from personhog.types.v1 import common_pb2 as _common_pb2
DESCRIPTOR: _descriptor.FileDescriptor
+class DeletePersonsMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
+ __slots__ = ()
+ DELETE_PERSONS_MODE_UNSPECIFIED: _ClassVar[DeletePersonsMode]
+ DELETE_PERSONS_MODE_HARD: _ClassVar[DeletePersonsMode]
+ DELETE_PERSONS_MODE_TOMBSTONE: _ClassVar[DeletePersonsMode]
+
class LifecycleOpType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
__slots__ = ()
LIFECYCLE_OP_TYPE_UNSPECIFIED: _ClassVar[LifecycleOpType]
@@ -33,6 +39,9 @@ class ReleaseOutcome(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
RELEASE_OUTCOME_COMMITTED: _ClassVar[ReleaseOutcome]
RELEASE_OUTCOME_ABORTED: _ClassVar[ReleaseOutcome]
+DELETE_PERSONS_MODE_UNSPECIFIED: DeletePersonsMode
+DELETE_PERSONS_MODE_HARD: DeletePersonsMode
+DELETE_PERSONS_MODE_TOMBSTONE: DeletePersonsMode
LIFECYCLE_OP_TYPE_UNSPECIFIED: LifecycleOpType
LIFECYCLE_OP_TYPE_DELETE: LifecycleOpType
LIFECYCLE_OP_TYPE_MERGE: LifecycleOpType
@@ -384,18 +393,57 @@ class UpdatePersonPropertiesResponse(_message.Message):
def __init__(self, person: _Optional[_Union[Person, _Mapping]] = ..., updated: bool = ...) -> None: ...
class DeletePersonsRequest(_message.Message):
- __slots__ = ("team_id", "person_uuids")
+ __slots__ = ("team_id", "person_uuids", "mode")
TEAM_ID_FIELD_NUMBER: _ClassVar[int]
PERSON_UUIDS_FIELD_NUMBER: _ClassVar[int]
+ MODE_FIELD_NUMBER: _ClassVar[int]
team_id: int
person_uuids: _containers.RepeatedScalarFieldContainer[str]
- def __init__(self, team_id: _Optional[int] = ..., person_uuids: _Optional[_Iterable[str]] = ...) -> None: ...
+ mode: DeletePersonsMode
+ def __init__(
+ self,
+ team_id: _Optional[int] = ...,
+ person_uuids: _Optional[_Iterable[str]] = ...,
+ mode: _Optional[_Union[DeletePersonsMode, str]] = ...,
+ ) -> None: ...
+
+class TombstonedDistinctId(_message.Message):
+ __slots__ = ("distinct_id", "version")
+ DISTINCT_ID_FIELD_NUMBER: _ClassVar[int]
+ VERSION_FIELD_NUMBER: _ClassVar[int]
+ distinct_id: str
+ version: int
+ def __init__(self, distinct_id: _Optional[str] = ..., version: _Optional[int] = ...) -> None: ...
+
+class TombstonedPerson(_message.Message):
+ __slots__ = ("person_uuid", "version", "distinct_ids")
+ PERSON_UUID_FIELD_NUMBER: _ClassVar[int]
+ VERSION_FIELD_NUMBER: _ClassVar[int]
+ DISTINCT_IDS_FIELD_NUMBER: _ClassVar[int]
+ person_uuid: str
+ version: int
+ distinct_ids: _containers.RepeatedCompositeFieldContainer[TombstonedDistinctId]
+ def __init__(
+ self,
+ person_uuid: _Optional[str] = ...,
+ version: _Optional[int] = ...,
+ distinct_ids: _Optional[_Iterable[_Union[TombstonedDistinctId, _Mapping]]] = ...,
+ ) -> None: ...
class DeletePersonsResponse(_message.Message):
- __slots__ = ("deleted_count",)
+ __slots__ = ("deleted_count", "tombstoned", "tombstones")
DELETED_COUNT_FIELD_NUMBER: _ClassVar[int]
+ TOMBSTONED_FIELD_NUMBER: _ClassVar[int]
+ TOMBSTONES_FIELD_NUMBER: _ClassVar[int]
deleted_count: int
- def __init__(self, deleted_count: _Optional[int] = ...) -> None: ...
+ tombstoned: bool
+ tombstones: _containers.RepeatedCompositeFieldContainer[TombstonedPerson]
+ def __init__(
+ self,
+ deleted_count: _Optional[int] = ...,
+ tombstoned: bool = ...,
+ tombstones: _Optional[_Iterable[_Union[TombstonedPerson, _Mapping]]] = ...,
+ ) -> None: ...
class DeletePersonsBatchForTeamRequest(_message.Message):
__slots__ = ("team_id", "batch_size")
diff --git a/posthog/personhog_client/fake_client.py b/posthog/personhog_client/fake_client.py
index a866cf573470..1e80ce6ac40b 100644
--- a/posthog/personhog_client/fake_client.py
+++ b/posthog/personhog_client/fake_client.py
@@ -622,14 +622,47 @@ class FakePersonHogClient:
self, request: person_pb2.DeletePersonsRequest, timeout: float | None = None
) -> person_pb2.DeletePersonsResponse:
self.calls.append(_Call("delete_persons", request))
- deleted_count = 0
+ tombstone = request.mode == person_pb2.DELETE_PERSONS_MODE_TOMBSTONE
+ response = person_pb2.DeletePersonsResponse(tombstoned=tombstone)
for uuid in request.person_uuids:
person = self._persons_by_uuid.get((request.team_id, uuid))
if person is None:
continue
- deleted_count += 1
- self._remove_person(request.team_id, person)
- return person_pb2.DeletePersonsResponse(deleted_count=deleted_count)
+ if not tombstone:
+ response.deleted_count += 1
+ self._remove_person(request.team_id, person)
+ continue
+ tombstoned = response.tombstones.add(person_uuid=person.uuid)
+ if person.is_deleted:
+ # Mirrors the server: an already tombstoned row is reported with the versions it
+ # holds and not counted, so a retry can publish the same ClickHouse tombstones.
+ tombstoned.version = person.version
+ for did in sorted(
+ self._distinct_ids.get((request.team_id, person.id), []), key=lambda d: d.distinct_id
+ ):
+ if (request.team_id, did.distinct_id) in self._tombstoned_distinct_ids:
+ tombstoned.distinct_ids.add(distinct_id=did.distinct_id, version=did.version)
+ continue
+ response.deleted_count += 1
+ tombstoned.version = self._tombstone_person(request.team_id, person, tombstoned)
+ response.tombstones.sort(key=lambda t: t.person_uuid)
+ return response
+
+ def _tombstone_person(
+ self, team_id: int, person: person_pb2.Person, tombstoned: person_pb2.TombstonedPerson
+ ) -> int:
+ """Tombstone a person and its distinct ids the way the replica does, reporting the versions."""
+ version = person.version + 1
+ person.is_deleted = True
+ person.version = version
+ person.properties = b"{}"
+ for did in sorted(self._distinct_ids.get((team_id, person.id), []), key=lambda d: d.distinct_id):
+ if (team_id, did.distinct_id) in self._tombstoned_distinct_ids:
+ continue
+ did.version = did.version + 1
+ self._tombstoned_distinct_ids.add((team_id, did.distinct_id))
+ tombstoned.distinct_ids.add(distinct_id=did.distinct_id, version=did.version)
+ return version
def delete_tombstoned_persons(
self, request: person_pb2.DeleteTombstonedPersonsRequest, timeout: float | None = None
diff --git a/posthog/personhog_client/proto/__init__.py b/posthog/personhog_client/proto/__init__.py
index 8ad36deddb5f..902767b31fd8 100644
--- a/posthog/personhog_client/proto/__init__.py
+++ b/posthog/personhog_client/proto/__init__.py
@@ -68,8 +68,11 @@ from personhog.types.v1.group_pb2 import (
from personhog.types.v1.person_pb2 import (
DeletePersonsBatchForTeamRequest,
DeletePersonsBatchForTeamResponse,
+ DeletePersonsMode,
DeletePersonsRequest,
DeletePersonsResponse,
+ TombstonedDistinctId,
+ TombstonedPerson,
DeleteTombstonedPersonsRequest,
DeleteTombstonedPersonsResponse,
GetDistinctIdsForPersonRequest,
diff --git a/posthog/personhog_client/test_fake_client.py b/posthog/personhog_client/test_fake_client.py
index 96033d75c688..3bc998918941 100644
--- a/posthog/personhog_client/test_fake_client.py
+++ b/posthog/personhog_client/test_fake_client.py
@@ -619,3 +619,38 @@ class TestFakePersonHogClientDeleteTombstonedPersons:
assert resp.deleted_count == 3
for uuid in ("tombstoned", "live", "blocked"):
assert not self._present(uuid)
+
+ def test_delete_persons_tombstone_mode_keeps_rows_and_reports_versions(self):
+ resp = self.client.delete_persons(
+ person_pb2.DeletePersonsRequest(
+ team_id=self.TEAM_ID,
+ person_uuids=["live", "tombstoned"],
+ mode=person_pb2.DELETE_PERSONS_MODE_TOMBSTONE,
+ )
+ )
+
+ # The live person reports what it wrote. The already tombstoned one is not counted, but it
+ # is reported with the versions it holds, like the replica, so a retry can republish them.
+ assert resp.tombstoned
+ assert resp.deleted_count == 1
+ assert [t.person_uuid for t in resp.tombstones] == ["live", "tombstoned"]
+ assert resp.tombstones[0].version == 1
+ assert [(d.distinct_id, d.version) for d in resp.tombstones[0].distinct_ids] == [("l-1", 1)]
+ assert [(d.distinct_id, d.version) for d in resp.tombstones[1].distinct_ids] == [("t-1", 0), ("t-2", 0)]
+ stored = self.client.get_person_by_uuid(
+ person_pb2.GetPersonByUuidRequest(team_id=self.TEAM_ID, uuid="live")
+ ).person
+ assert stored.is_deleted
+ assert stored.version == 1
+
+ hard = self.client.delete_persons(
+ person_pb2.DeletePersonsRequest(
+ team_id=self.TEAM_ID, person_uuids=["live"], mode=person_pb2.DELETE_PERSONS_MODE_HARD
+ )
+ )
+ assert hard.deleted_count == 1
+ assert not hard.tombstoned
+ assert (
+ self.client.get_person(person_pb2.GetPersonRequest(team_id=self.TEAM_ID, person_id=2)).HasField("person")
+ is False
+ )
diff --git a/posthog/temporal/delete_persons/delete_persons_workflow.py b/posthog/temporal/delete_persons/delete_persons_workflow.py
index b6bd257314cc..e5dacdf38e6d 100644
--- a/posthog/temporal/delete_persons/delete_persons_workflow.py
+++ b/posthog/temporal/delete_persons/delete_persons_workflow.py
@@ -35,7 +35,7 @@ def _delete_specific_persons_via_personhog(team_id: int, person_ids: list[int])
"""
from posthog.personhog_client.caller_tag import personhog_caller_tag
from posthog.personhog_client.client import get_personhog_client
- from posthog.personhog_client.proto import DeletePersonsRequest, GetPersonsRequest
+ from posthog.personhog_client.proto import DeletePersonsMode, DeletePersonsRequest, GetPersonsRequest
client = get_personhog_client()
if client is None:
@@ -49,7 +49,15 @@ def _delete_specific_persons_via_personhog(team_id: int, person_ids: list[int])
deleted = 0
for uuid_chunk in _chunked(uuids, DELETE_PERSONS_MAX_UUIDS):
- delete_resp = client.delete_persons(DeletePersonsRequest(team_id=team_id, person_uuids=uuid_chunk))
+ # A purge publishes no ClickHouse tombstones, so the rows must go rather than
+ # stay behind as tombstones nothing would ever sweep.
+ delete_resp = client.delete_persons(
+ DeletePersonsRequest(
+ team_id=team_id,
+ person_uuids=uuid_chunk,
+ mode=DeletePersonsMode.DELETE_PERSONS_MODE_HARD,
+ )
+ )
deleted += delete_resp.deleted_count
return deleted
diff --git a/proto/personhog/types/v1/person.proto b/proto/personhog/types/v1/person.proto
index 9888482474a9..2334ac93ae55 100644
--- a/proto/personhog/types/v1/person.proto
+++ b/proto/personhog/types/v1/person.proto
@@ -186,17 +186,50 @@ message UpdatePersonPropertiesResponse {
bool updated = 2;
}
-// DeletePersonsRequest deletes persons from Postgres by UUID.
-// Also deletes associated posthog_persondistinctid rows (FK is NO ACTION).
-// posthog_featureflaghashkeyoverride rows cascade automatically at the DB level.
+// How DeletePersons removes the rows.
+enum DeletePersonsMode {
+ // Same as HARD.
+ DELETE_PERSONS_MODE_UNSPECIFIED = 0;
+ // Remove the rows, tombstoned ones included. For callers that publish no
+ // ClickHouse tombstones and want nothing left behind, such as a purge.
+ DELETE_PERSONS_MODE_HARD = 1;
+ // Keep the rows as tombstones and report the versions written. The caller
+ // owns the prerequisite: ingestion must revive tombstones for the team.
+ DELETE_PERSONS_MODE_TOMBSTONE = 2;
+}
+
+// DeletePersonsRequest deletes persons from Postgres by UUID, together with
+// their posthog_persondistinctid, posthog_cohortpeople and
+// posthog_featureflaghashkeyoverride rows (nothing cascades them).
message DeletePersonsRequest {
int64 team_id = 1;
// Person UUIDs to delete. Max 1000 per request.
repeated string person_uuids = 2;
+ DeletePersonsMode mode = 3;
+}
+
+message TombstonedDistinctId {
+ string distinct_id = 1;
+ int64 version = 2;
+}
+
+message TombstonedPerson {
+ string person_uuid = 1;
+ int64 version = 2;
+ repeated TombstonedDistinctId distinct_ids = 3;
}
message DeletePersonsResponse {
int64 deleted_count = 1;
+ // True when the rows were tombstoned rather than removed.
+ bool tombstoned = 2;
+ // One entry per requested person that is tombstoned after the call, with the
+ // versions its rows hold, so the caller can publish its ClickHouse tombstones
+ // at exactly those versions. Persons tombstoned before the call are included
+ // too, so a retry after a lost response gets the same versions again;
+ // deleted_count counts only the rows this call tombstoned. Empty on a hard
+ // delete.
+ repeated TombstonedPerson tombstones = 3;
}
// DeletePersonsBatchForTeamRequest deletes up to batch_size persons for a team.
diff --git a/rust/personhog-replica/.sqlx/query-05c7c839951d1e77dcd01fd82f17d4721445c04f5f17951fdfab52f49ff10521.json b/rust/personhog-replica/.sqlx/query-05c7c839951d1e77dcd01fd82f17d4721445c04f5f17951fdfab52f49ff10521.json
new file mode 100644
index 000000000000..dd136e331176
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-05c7c839951d1e77dcd01fd82f17d4721445c04f5f17951fdfab52f49ff10521.json
@@ -0,0 +1,35 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT person_id as \"person_id!\", distinct_id as \"distinct_id!\",\n COALESCE(version, 0)::bigint as \"version!\"\n FROM posthog_persondistinctid\n WHERE team_id = $1 AND person_id = ANY($2) AND is_deleted = true\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "person_id!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "distinct_id!",
+ "type_info": "Varchar"
+ },
+ {
+ "ordinal": 2,
+ "name": "version!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ null
+ ]
+ },
+ "hash": "05c7c839951d1e77dcd01fd82f17d4721445c04f5f17951fdfab52f49ff10521"
+}
diff --git a/rust/personhog-replica/.sqlx/query-242b073065c180efabef590732adefad0f60b47f0e91b571bababaf35f27336f.json b/rust/personhog-replica/.sqlx/query-242b073065c180efabef590732adefad0f60b47f0e91b571bababaf35f27336f.json
new file mode 100644
index 000000000000..5ddcfd725af7
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-242b073065c180efabef590732adefad0f60b47f0e91b571bababaf35f27336f.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n DELETE FROM posthog_featureflaghashkeyoverride\n WHERE team_id = $1 AND person_id = ANY($2)\n ",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "242b073065c180efabef590732adefad0f60b47f0e91b571bababaf35f27336f"
+}
diff --git a/rust/personhog-replica/.sqlx/query-48fcc15353aa9cc89ddeebfcda8b46c73dd4d6375db2eba2234f28d0b27649dd.json b/rust/personhog-replica/.sqlx/query-48fcc15353aa9cc89ddeebfcda8b46c73dd4d6375db2eba2234f28d0b27649dd.json
new file mode 100644
index 000000000000..e5bdd3ee0813
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-48fcc15353aa9cc89ddeebfcda8b46c73dd4d6375db2eba2234f28d0b27649dd.json
@@ -0,0 +1,35 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE posthog_person\n SET is_deleted = true,\n version = COALESCE(version, 0) + 1,\n properties = '{}'::jsonb,\n properties_last_updated_at = '{}'::jsonb,\n properties_last_operation = '{}'::jsonb\n WHERE team_id = $1 AND id = ANY($2) AND is_deleted = false\n RETURNING id as \"id!\", uuid as \"uuid!\", version as \"version!\"\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "uuid!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "version!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "48fcc15353aa9cc89ddeebfcda8b46c73dd4d6375db2eba2234f28d0b27649dd"
+}
diff --git a/rust/personhog-replica/.sqlx/query-6673616d7e4b0a420ddf2e7ba4f64bfb8b291688c49c14f8e2631297ee66e488.json b/rust/personhog-replica/.sqlx/query-6673616d7e4b0a420ddf2e7ba4f64bfb8b291688c49c14f8e2631297ee66e488.json
new file mode 100644
index 000000000000..981b776b36d9
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-6673616d7e4b0a420ddf2e7ba4f64bfb8b291688c49c14f8e2631297ee66e488.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT id FROM posthog_person\n WHERE team_id = $1 AND id = ANY($2)\n ORDER BY id FOR UPDATE\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": [
+ false
+ ]
+ },
+ "hash": "6673616d7e4b0a420ddf2e7ba4f64bfb8b291688c49c14f8e2631297ee66e488"
+}
diff --git a/rust/personhog-replica/.sqlx/query-69b20f423f894150048e26f711c8ecfd87b80b69fd497418aeeaf3e81284f2e6.json b/rust/personhog-replica/.sqlx/query-69b20f423f894150048e26f711c8ecfd87b80b69fd497418aeeaf3e81284f2e6.json
new file mode 100644
index 000000000000..17eedaee217e
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-69b20f423f894150048e26f711c8ecfd87b80b69fd497418aeeaf3e81284f2e6.json
@@ -0,0 +1,23 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT id FROM posthog_persondistinctid\n WHERE team_id = $1 AND person_id = ANY($2)\n ORDER BY id FOR UPDATE\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": [
+ false
+ ]
+ },
+ "hash": "69b20f423f894150048e26f711c8ecfd87b80b69fd497418aeeaf3e81284f2e6"
+}
diff --git a/rust/personhog-replica/.sqlx/query-addc1747821f2f45601a9524ee8f70aa58c8c2173e9e9aa2ba18632a5da005db.json b/rust/personhog-replica/.sqlx/query-addc1747821f2f45601a9524ee8f70aa58c8c2173e9e9aa2ba18632a5da005db.json
new file mode 100644
index 000000000000..6db73d6cdcc0
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-addc1747821f2f45601a9524ee8f70aa58c8c2173e9e9aa2ba18632a5da005db.json
@@ -0,0 +1,41 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT id::bigint as \"id!\", uuid as \"uuid!\",\n COALESCE(version, 0)::bigint as \"version!\", is_deleted as \"is_deleted!\"\n FROM posthog_person\n WHERE team_id = $1 AND uuid = ANY($2)\n ORDER BY id FOR UPDATE\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "uuid!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 2,
+ "name": "version!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 3,
+ "name": "is_deleted!",
+ "type_info": "Bool"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "UuidArray"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ null,
+ false
+ ]
+ },
+ "hash": "addc1747821f2f45601a9524ee8f70aa58c8c2173e9e9aa2ba18632a5da005db"
+}
diff --git a/rust/personhog-replica/.sqlx/query-af9bbe81a3aa0f9d07a3a7eb63a623a35ad7dcabe20147e46abfcb3d385635fd.json b/rust/personhog-replica/.sqlx/query-af9bbe81a3aa0f9d07a3a7eb63a623a35ad7dcabe20147e46abfcb3d385635fd.json
new file mode 100644
index 000000000000..28ec9d92ad0f
--- /dev/null
+++ b/rust/personhog-replica/.sqlx/query-af9bbe81a3aa0f9d07a3a7eb63a623a35ad7dcabe20147e46abfcb3d385635fd.json
@@ -0,0 +1,35 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n UPDATE posthog_persondistinctid\n SET is_deleted = true, version = COALESCE(version, 0) + 1\n WHERE team_id = $1 AND person_id = ANY($2) AND is_deleted = false\n RETURNING person_id as \"person_id!\", distinct_id as \"distinct_id!\", version as \"version!\"\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "person_id!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "distinct_id!",
+ "type_info": "Varchar"
+ },
+ {
+ "ordinal": 2,
+ "name": "version!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int4",
+ "Int8Array"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "af9bbe81a3aa0f9d07a3a7eb63a623a35ad7dcabe20147e46abfcb3d385635fd"
+}
diff --git a/rust/personhog-replica/README.md b/rust/personhog-replica/README.md
index bb52cf1ceccc..997e331265c5 100644
--- a/rust/personhog-replica/README.md
+++ b/rust/personhog-replica/README.md
@@ -6,6 +6,15 @@
- provides a cheap, quickly scalable, operationally simple request path for simple data access patterns
- gRPC service
+### Person deletes
+
+`DeletePersons` hard-deletes person and distinct-id rows unless the request asks for `DELETE_PERSONS_MODE_TOMBSTONE`.
+A tombstone keeps the rows with `is_deleted = true`, the version bumped by one, and person properties scrubbed, and the response reports the versions written so the caller can publish ClickHouse tombstones at exactly those versions.
+The row's version counter survives, so a later create on the same key revives it above its own ClickHouse tombstone instead of restarting at version 0.
+The tombstone cleanup drain (`DeleteTombstonedPersons`) removes the rows later, once their ClickHouse history is gone.
+`DeletePersonsBatchForTeam` always hard-deletes, tombstoned rows included: it serves team teardown, where no sweep would ever clean the tombstones up.
+Hard deletes remove tombstoned rows too, so a caller that stops asking for tombstones leaves nothing behind.
+
### Known Implementation Details
```mermaid
diff --git a/rust/personhog-replica/src/config.rs b/rust/personhog-replica/src/config.rs
index 35b13d2b6264..4cf3892c4c4b 100644
--- a/rust/personhog-replica/src/config.rs
+++ b/rust/personhog-replica/src/config.rs
@@ -67,7 +67,6 @@ pub struct Config {
/// measured tail cost on the persons tables is up to 5 ms per row.
#[envconfig(default = "5000")]
pub tombstoned_delete_max_rows: usize,
-
/// Maximum number of server-side (PgBouncer → Postgres) connections to
/// warm at startup via SELECT 1. Clamped to min_pg_connections. Set to 0
/// to skip server-side warming entirely.
diff --git a/rust/personhog-replica/src/service/mod.rs b/rust/personhog-replica/src/service/mod.rs
index ac7b353d13a8..c08acabb0961 100644
--- a/rust/personhog-replica/src/service/mod.rs
+++ b/rust/personhog-replica/src/service/mod.rs
@@ -19,9 +19,10 @@ use personhog_proto::personhog::types::v1::{
DeleteGroupTypeMappingsBatchForTeamRequest, DeleteGroupTypeMappingsBatchForTeamResponse,
DeleteGroupsBatchForTeamRequest, DeleteGroupsBatchForTeamResponse,
DeleteHashKeyOverridesByTeamsRequest, DeleteHashKeyOverridesByTeamsResponse,
- DeletePersonsBatchForTeamRequest, DeletePersonsBatchForTeamResponse, DeletePersonsRequest,
- DeletePersonsResponse, DeleteTombstonedPersonsRequest, DeleteTombstonedPersonsResponse,
- DistinctIdWithVersion, GetDistinctIdsForPersonRequest, GetDistinctIdsForPersonResponse,
+ DeletePersonsBatchForTeamRequest, DeletePersonsBatchForTeamResponse,
+ DeletePersonsMode as ProtoDeletePersonsMode, DeletePersonsRequest, DeletePersonsResponse,
+ DeleteTombstonedPersonsRequest, DeleteTombstonedPersonsResponse, DistinctIdWithVersion,
+ GetDistinctIdsForPersonRequest, GetDistinctIdsForPersonResponse,
GetDistinctIdsForPersonsRequest, GetDistinctIdsForPersonsResponse, GetGroupRequest,
GetGroupResponse, GetGroupTypeMappingByDashboardIdRequest,
GetGroupTypeMappingByDashboardIdResponse, GetGroupTypeMappingsByProjectIdRequest,
@@ -40,13 +41,14 @@ use personhog_proto::personhog::types::v1::{
PersonsResponse, SetPersonDistinctIdVersionFloorRequest,
SetPersonDistinctIdVersionFloorResponse, SetPersonVersionFloorRequest,
SetPersonVersionFloorResponse, SplitPersonRequest, SplitPersonResponse,
- SplitResult as ProtoSplitResult, TeamDistinctId, UpdateGroupRequest, UpdateGroupResponse,
- UpdateGroupTypeMappingRequest, UpdateGroupTypeMappingResponse, UpsertHashKeyOverridesRequest,
- UpsertHashKeyOverridesResponse,
+ SplitResult as ProtoSplitResult, TeamDistinctId, TombstonedDistinctId, TombstonedPerson,
+ UpdateGroupRequest, UpdateGroupResponse, UpdateGroupTypeMappingRequest,
+ UpdateGroupTypeMappingResponse, UpsertHashKeyOverridesRequest, UpsertHashKeyOverridesResponse,
};
use tonic::{Request, Response, Status};
use uuid::Uuid;
+use crate::storage::types::DeletePersonsMode;
use crate::storage::{self, FullStorage};
const MAX_BATCH_LOOKUP_SIZE: usize = 250;
@@ -417,13 +419,48 @@ impl PersonHogReplica for PersonHogReplicaService {
.collect::<Result<Vec<_>, _>>()
.map_err(|e| Status::invalid_argument(format!("Invalid UUID: {e}")))?;
- let deleted_count = self
+ let mode = match ProtoDeletePersonsMode::try_from(req.mode) {
+ Ok(ProtoDeletePersonsMode::Unspecified) => DeletePersonsMode::Hard,
+ Ok(ProtoDeletePersonsMode::Hard) => DeletePersonsMode::Hard,
+ Ok(ProtoDeletePersonsMode::Tombstone) => DeletePersonsMode::Tombstone,
+ Err(_) => {
+ return Err(Status::invalid_argument(format!(
+ "Unknown DeletePersonsMode {}",
+ req.mode
+ )))
+ }
+ };
+
+ let outcome = self
.storage
- .delete_persons(req.team_id, &uuids)
+ .delete_persons(req.team_id, &uuids, mode)
.await
.map_err(|e| log_and_convert_error(e, "delete_persons"))?;
- Ok(Response::new(DeletePersonsResponse { deleted_count }))
+ let tombstoned = outcome.tombstones.is_some();
+ let tombstones = outcome
+ .tombstones
+ .unwrap_or_default()
+ .into_iter()
+ .map(|person| TombstonedPerson {
+ person_uuid: person.uuid.to_string(),
+ version: person.version,
+ distinct_ids: person
+ .distinct_ids
+ .into_iter()
+ .map(|did| TombstonedDistinctId {
+ distinct_id: did.distinct_id,
+ version: did.version,
+ })
+ .collect(),
+ })
+ .collect();
+
+ Ok(Response::new(DeletePersonsResponse {
+ deleted_count: outcome.deleted,
+ tombstoned,
+ tombstones,
+ }))
}
async fn delete_persons_batch_for_team(
diff --git a/rust/personhog-replica/src/service/tests/mocks.rs b/rust/personhog-replica/src/service/tests/mocks.rs
index ec5978a5b67a..68a128362bde 100644
--- a/rust/personhog-replica/src/service/tests/mocks.rs
+++ b/rust/personhog-replica/src/service/tests/mocks.rs
@@ -91,7 +91,12 @@ impl storage::PersonLookup for FailingStorage {
Err(self.error.clone())
}
- async fn delete_persons(&self, _team_id: i64, _uuids: &[Uuid]) -> storage::StorageResult<i64> {
+ async fn delete_persons(
+ &self,
+ _team_id: i64,
+ _uuids: &[Uuid],
+ _mode: storage::DeletePersonsMode,
+ ) -> storage::StorageResult<storage::DeletePersonsOutcome> {
Err(self.error.clone())
}
@@ -475,8 +480,13 @@ impl storage::PersonLookup for SuccessStorage {
.collect())
}
- async fn delete_persons(&self, _team_id: i64, _uuids: &[Uuid]) -> storage::StorageResult<i64> {
- Ok(0)
+ async fn delete_persons(
+ &self,
+ _team_id: i64,
+ _uuids: &[Uuid],
+ _mode: storage::DeletePersonsMode,
+ ) -> storage::StorageResult<storage::DeletePersonsOutcome> {
+ Ok(storage::DeletePersonsOutcome::default())
}
async fn delete_tombstoned_persons(
@@ -918,8 +928,13 @@ impl storage::PersonLookup for PopulatedStorage {
.collect())
}
- async fn delete_persons(&self, _team_id: i64, _uuids: &[Uuid]) -> storage::StorageResult<i64> {
- Ok(0)
+ async fn delete_persons(
+ &self,
+ _team_id: i64,
+ _uuids: &[Uuid],
+ _mode: storage::DeletePersonsMode,
+ ) -> storage::StorageResult<storage::DeletePersonsOutcome> {
+ Ok(storage::DeletePersonsOutcome::default())
}
async fn delete_tombstoned_persons(
@@ -1337,8 +1352,13 @@ impl storage::PersonLookup for ConsistencyTrackingStorage {
.collect())
}
- async fn delete_persons(&self, _team_id: i64, _uuids: &[Uuid]) -> storage::StorageResult<i64> {
- Ok(0)
+ async fn delete_persons(
+ &self,
+ _team_id: i64,
+ _uuids: &[Uuid],
+ _mode: storage::DeletePersonsMode,
+ ) -> storage::StorageResult<storage::DeletePersonsOutcome> {
+ Ok(storage::DeletePersonsOutcome::default())
}
async fn delete_tombstoned_persons(
diff --git a/rust/personhog-replica/src/service/tests/mod.rs b/rust/personhog-replica/src/service/tests/mod.rs
index ca4ef0519b11..601c3f4e3864 100644
--- a/rust/personhog-replica/src/service/tests/mod.rs
+++ b/rust/personhog-replica/src/service/tests/mod.rs
@@ -130,6 +130,7 @@ async fn test_delete_persons_storage_error(
.delete_persons(Request::new(DeletePersonsRequest {
team_id: 1,
person_uuids: vec!["00000000-0000-0000-0000-000000000001".to_string()],
+ mode: 0,
}))
.await;
@@ -153,6 +154,7 @@ async fn test_delete_persons_invalid_input(
.delete_persons(Request::new(DeletePersonsRequest {
team_id: 1,
person_uuids,
+ mode: 0,
}))
.await
.unwrap_err();
@@ -169,6 +171,7 @@ async fn test_delete_persons_empty_uuids_returns_zero() {
.delete_persons(Request::new(DeletePersonsRequest {
team_id: 1,
person_uuids: vec![],
+ mode: 0,
}))
.await;
@@ -186,6 +189,7 @@ async fn test_delete_persons_success(#[case] person_uuids: Vec<String>) {
.delete_persons(Request::new(DeletePersonsRequest {
team_id: 1,
person_uuids,
+ mode: 0,
}))
.await;
diff --git a/rust/personhog-replica/src/storage/mod.rs b/rust/personhog-replica/src/storage/mod.rs
index a53d4ed8225c..afef277b144c 100644
--- a/rust/personhog-replica/src/storage/mod.rs
+++ b/rust/personhog-replica/src/storage/mod.rs
@@ -6,9 +6,10 @@ pub mod types;
pub use error::{StorageError, StorageResult};
pub use types::{
- CohortMembership, DistinctIdMapping, DistinctIdWithVersion, Group, GroupIdentifier, GroupKey,
- GroupTypeMapping, HashKeyOverride, HashKeyOverrideContext, Person, SplitResult,
- TombstonedDeleteOutcome,
+ CohortMembership, DeletePersonsMode, DeletePersonsOutcome, DistinctIdMapping,
+ DistinctIdWithVersion, Group, GroupIdentifier, GroupKey, GroupTypeMapping, HashKeyOverride,
+ HashKeyOverrideContext, Person, SplitResult, TombstonedDeleteOutcome, TombstonedDistinctId,
+ TombstonedPerson,
};
pub use traits::{CohortStorage, DistinctIdLookup, FeatureFlagStorage, GroupStorage, PersonLookup};
diff --git a/rust/personhog-replica/src/storage/postgres/person.rs b/rust/personhog-replica/src/storage/postgres/person.rs
index f20a0128ce18..f73773e23d3a 100644
--- a/rust/personhog-replica/src/storage/postgres/person.rs
+++ b/rust/personhog-replica/src/storage/postgres/person.rs
@@ -12,7 +12,10 @@ use personhog_common::grpc::{current_client_name, current_method_name};
use super::{PostgresStorage, DB_BULK_CHUNKS, DB_QUERY_DURATION, DB_ROWS_RETURNED};
use crate::storage::error::{StorageError, StorageResult};
use crate::storage::traits::PersonLookup;
-use crate::storage::types::{Person, SplitResult, TombstonedDeleteOutcome};
+use crate::storage::types::{
+ DeletePersonsMode, DeletePersonsOutcome, Person, SplitResult, TombstonedDeleteOutcome,
+ TombstonedDistinctId, TombstonedPerson,
+};
/// Version offset for split person/PDI rows — mirrors the Django convention.
const SPLIT_VERSION_OFFSET: i64 = 101;
@@ -414,9 +417,14 @@ impl PersonLookup for PostgresStorage {
.collect())
}
- async fn delete_persons(&self, team_id: i64, uuids: &[Uuid]) -> StorageResult<i64> {
+ async fn delete_persons(
+ &self,
+ team_id: i64,
+ uuids: &[Uuid],
+ mode: DeletePersonsMode,
+ ) -> StorageResult<DeletePersonsOutcome> {
if uuids.is_empty() {
- return Ok(0);
+ return Ok(DeletePersonsOutcome::default());
}
let client = current_client_name();
@@ -429,9 +437,13 @@ impl PersonLookup for PostgresStorage {
];
let _timer = common_metrics::timing_guard(DB_QUERY_DURATION, &labels);
+ if mode == DeletePersonsMode::Tombstone {
+ return tombstone_persons_by_uuids(self, team_id, uuids, &client).await;
+ }
+
// Resolve UUIDs to integer IDs in one query, then chunk and delete
// by ID. This avoids scanning the UUID index per-chunk.
- let person_ids: Vec<i64> = sqlx::query_scalar!(
+ let mut person_ids: Vec<i64> = sqlx::query_scalar!(
r#"
SELECT id::bigint as "id!" FROM posthog_person
WHERE team_id = $1 AND uuid = ANY($2)
@@ -443,8 +455,9 @@ impl PersonLookup for PostgresStorage {
.await?;
if person_ids.is_empty() {
- return Ok(0);
+ return Ok(DeletePersonsOutcome::default());
}
+ person_ids.sort_unstable();
// Split into fixed-size chunks and delete concurrently. On the first
// error, stop starting new chunks and return the error. Chunks that
@@ -475,7 +488,10 @@ impl PersonLookup for PostgresStorage {
.try_collect()
.await?;
- Ok(results.iter().sum())
+ Ok(DeletePersonsOutcome {
+ deleted: results.iter().sum(),
+ tombstones: None,
+ })
}
async fn delete_persons_batch_for_team(
@@ -500,8 +516,9 @@ impl PersonLookup for PostgresStorage {
];
let _timer = common_metrics::timing_guard(DB_QUERY_DURATION, &labels);
- // Select up to batch_size person IDs.
- let person_ids: Vec<i64> = sqlx::query_scalar!(
+ // Team teardown always removes the rows, tombstoned ones included: nothing
+ // sweeps a deleted team's tombstones into the cleanup queue.
+ let mut person_ids: Vec<i64> = sqlx::query_scalar!(
r#"
SELECT id::bigint as "id!" FROM posthog_person
WHERE team_id = $1
@@ -516,6 +533,7 @@ impl PersonLookup for PostgresStorage {
if person_ids.is_empty() {
return Ok(0);
}
+ person_ids.sort_unstable();
// Split into fixed-size chunks and delete concurrently.
let pool = self.bulk_primary_pool.clone();
@@ -1192,9 +1210,254 @@ impl PersonLookup for PostgresStorage {
}
}
-/// Delete a chunk of persons by integer ID in a single transaction:
-/// distinct_ids first (FK is NO ACTION), then persons (feature flag hash
-/// key overrides cascade at the DB level).
+/// Tombstone the requested persons in one transaction, so the caller gets
+/// exactly the versions committed, or none. Persons already tombstoned are
+/// reported with the versions they hold, so a retry can republish them.
+async fn tombstone_persons_by_uuids(
+ storage: &PostgresStorage,
+ team_id: i64,
+ uuids: &[Uuid],
+ client: &str,
+) -> StorageResult<DeletePersonsOutcome> {
+ let mut tx = storage.bulk_primary_pool.begin().await?;
+ // A held row means a merge or revival in flight: fail fast and let the
+ // caller retry, as the tombstone drain does, instead of queueing behind it.
+ sqlx::query("SET LOCAL lock_timeout = '2s'")
+ .execute(&mut *tx)
+ .await?;
+
+ // Lock every requested person up front, in id order, the order the
+ // ingestion writer and the tombstone drain take their locks in.
+ let rows = sqlx::query!(
+ r#"
+ SELECT id::bigint as "id!", uuid as "uuid!",
+ COALESCE(version, 0)::bigint as "version!", is_deleted as "is_deleted!"
+ FROM posthog_person
+ WHERE team_id = $1 AND uuid = ANY($2)
+ ORDER BY id FOR UPDATE
+ "#,
+ team_id as i32,
+ uuids
+ )
+ .fetch_all(&mut *tx)
+ .await?;
+ let mut tombstones: Vec<TombstonedPerson> = Vec::with_capacity(rows.len());
+ let mut already: Vec<(i64, Uuid, i64)> = Vec::new();
+ let mut live: Vec<i64> = Vec::new();
+ for row in rows {
+ if row.is_deleted {
+ already.push((row.id, row.uuid, row.version));
+ } else {
+ live.push(row.id);
+ }
+ }
+
+ let chunks: Vec<Vec<i64>> = live
+ .chunks(storage.bulk_chunk_size)
+ .map(|c| c.to_vec())
+ .collect();
+ common_metrics::histogram(
+ DB_BULK_CHUNKS,
+ &[("operation".to_string(), "tombstone_persons".to_string())],
+ chunks.len() as f64,
+ );
+ for chunk in &chunks {
+ // Per-person delete: also clear cohort memberships (no DB cascade).
+ tombstones
+ .extend(tombstone_persons_by_ids_in_tx(&mut tx, team_id, chunk, client, true).await?);
+ }
+ let deleted = tombstones.len() as i64;
+
+ if !already.is_empty() {
+ let already_ids: Vec<i64> = already.iter().map(|(id, _, _)| *id).collect();
+ let dids = sqlx::query!(
+ r#"
+ SELECT person_id as "person_id!", distinct_id as "distinct_id!",
+ COALESCE(version, 0)::bigint as "version!"
+ FROM posthog_persondistinctid
+ WHERE team_id = $1 AND person_id = ANY($2) AND is_deleted = true
+ "#,
+ team_id as i32,
+ &already_ids
+ )
+ .fetch_all(&mut *tx)
+ .await?;
+ tombstones.extend(build_tombstones(
+ already,
+ dids.into_iter()
+ .map(|row| (row.person_id, row.distinct_id, row.version))
+ .collect(),
+ ));
+ }
+
+ tx.commit().await?;
+ tombstones.sort_by(|a, b| a.uuid.cmp(&b.uuid));
+ Ok(DeletePersonsOutcome {
+ deleted,
+ tombstones: Some(tombstones),
+ })
+}
+
+/// Tombstone one chunk of persons inside the caller's transaction: their
+/// rows get `is_deleted = true` and version + 1, properties scrubbed. The rows
+/// stay so a later create on the same key revives above this version.
+async fn tombstone_persons_by_ids_in_tx(
+ tx: &mut Transaction<'_, Postgres>,
+ team_id: i64,
+ person_ids: &[i64],
+ client: &str,
+ delete_cohortpeople: bool,
+) -> StorageResult<Vec<TombstonedPerson>> {
+ if person_ids.is_empty() {
+ return Ok(Vec::new());
+ }
+ let chunk_labels = [
+ (
+ "operation".to_string(),
+ "tombstone_persons_chunk".to_string(),
+ ),
+ ("pool".to_string(), "bulk_primary".to_string()),
+ ("client".to_string(), client.to_string()),
+ ("method".to_string(), current_method_name().to_string()),
+ ];
+ let _chunk_timer = common_metrics::timing_guard(DB_QUERY_DURATION, &chunk_labels);
+
+ // Take the distinct-id row locks up front, in id order. The multi-row
+ // updates below lock in whatever order the plan visits rows, and the
+ // ingestion writer updates overlapping rows in sorted batches; sorted
+ // acquisition on both sides rules out a deadlock cycle.
+ sqlx::query!(
+ r#"
+ SELECT id FROM posthog_persondistinctid
+ WHERE team_id = $1 AND person_id = ANY($2)
+ ORDER BY id FOR UPDATE
+ "#,
+ team_id as i32,
+ person_ids
+ )
+ .fetch_all(&mut **tx)
+ .await?;
+
+ let tombstoned_dids = sqlx::query!(
+ r#"
+ UPDATE posthog_persondistinctid
+ SET is_deleted = true, version = COALESCE(version, 0) + 1
+ WHERE team_id = $1 AND person_id = ANY($2) AND is_deleted = false
+ RETURNING person_id as "person_id!", distinct_id as "distinct_id!", version as "version!"
+ "#,
+ team_id as i32,
+ person_ids
+ )
+ .fetch_all(&mut **tx)
+ .await?;
+
+ common_metrics::histogram(
+ DB_ROWS_RETURNED,
+ &[
+ (
+ "operation".to_string(),
+ "tombstone_distinct_ids".to_string(),
+ ),
+ ("pool".to_string(), "bulk_primary".to_string()),
+ ("client".to_string(), client.to_string()),
+ ("method".to_string(), current_method_name().to_string()),
+ ],
+ tombstoned_dids.len() as f64,
+ );
+
+ if delete_cohortpeople {
+ sqlx::query!(
+ r#"
+ DELETE FROM posthog_cohortpeople
+ WHERE person_id = ANY($1)
+ "#,
+ person_ids
+ )
+ .execute(&mut **tx)
+ .await?;
+ }
+
+ // The person row stays, so the FK cascade never fires; remove the overrides here.
+ sqlx::query!(
+ r#"
+ DELETE FROM posthog_featureflaghashkeyoverride
+ WHERE team_id = $1 AND person_id = ANY($2)
+ "#,
+ team_id as i32,
+ person_ids
+ )
+ .execute(&mut **tx)
+ .await?;
+
+ let tombstoned_persons = sqlx::query!(
+ r#"
+ UPDATE posthog_person
+ SET is_deleted = true,
+ version = COALESCE(version, 0) + 1,
+ properties = '{}'::jsonb,
+ properties_last_updated_at = '{}'::jsonb,
+ properties_last_operation = '{}'::jsonb
+ WHERE team_id = $1 AND id = ANY($2) AND is_deleted = false
+ RETURNING id as "id!", uuid as "uuid!", version as "version!"
+ "#,
+ team_id as i32,
+ person_ids
+ )
+ .fetch_all(&mut **tx)
+ .await?;
+
+ common_metrics::histogram(
+ DB_ROWS_RETURNED,
+ &[
+ ("operation".to_string(), "tombstone_persons".to_string()),
+ ("pool".to_string(), "bulk_primary".to_string()),
+ ("client".to_string(), client.to_string()),
+ ("method".to_string(), current_method_name().to_string()),
+ ],
+ tombstoned_persons.len() as f64,
+ );
+
+ Ok(build_tombstones(
+ tombstoned_persons
+ .into_iter()
+ .map(|row| (row.id, row.uuid, row.version))
+ .collect(),
+ tombstoned_dids
+ .into_iter()
+ .map(|row| (row.person_id, row.distinct_id, row.version))
+ .collect(),
+ ))
+}
+
+/// Distinct ids are sorted by name so a retry reports the same list as the original call.
+fn build_tombstones(
+ persons: Vec<(i64, Uuid, i64)>,
+ dids: Vec<(i64, String, i64)>,
+) -> Vec<TombstonedPerson> {
+ let mut by_person: HashMap<i64, Vec<TombstonedDistinctId>> = HashMap::new();
+ for (person_id, distinct_id, version) in dids {
+ by_person
+ .entry(person_id)
+ .or_default()
+ .push(TombstonedDistinctId {
+ distinct_id,
+ version,
+ });
+ }
+ persons
+ .into_iter()
+ .map(|(id, uuid, version)| {
+ let mut distinct_ids = by_person.remove(&id).unwrap_or_default();
+ distinct_ids.sort_by(|a, b| a.distinct_id.cmp(&b.distinct_id));
+ TombstonedPerson {
+ uuid,
+ version,
+ distinct_ids,
+ }
+ })
+ .collect()
+}
+
async fn delete_persons_by_ids_chunk(
pool: &PgPool,
team_id: i64,
@@ -1254,6 +1517,20 @@ async fn delete_persons_by_ids_in_tx(
}
let mut rows = PersonRowsDeleted::default();
+ // Lock persons before their distinct ids, the order ingestion and the
+ // tombstone paths take, so a concurrent tombstone cannot deadlock with us.
+ sqlx::query!(
+ r#"
+ SELECT id FROM posthog_person
+ WHERE team_id = $1 AND id = ANY($2)
+ ORDER BY id FOR UPDATE
+ "#,
+ team_id as i32,
+ person_ids
+ )
+ .fetch_all(&mut **tx)
+ .await?;
+
// Delete distinct_id rows first — FK is NO ACTION.
let did_result = sqlx::query!(
r#"
diff --git a/rust/personhog-replica/src/storage/traits/person.rs b/rust/personhog-replica/src/storage/traits/person.rs
index 857eb1c1a849..d5d3cd933fa6 100644
--- a/rust/personhog-replica/src/storage/traits/person.rs
+++ b/rust/personhog-replica/src/storage/traits/person.rs
@@ -2,7 +2,9 @@ use async_trait::async_trait;
use uuid::Uuid;
use crate::storage::error::StorageResult;
-use crate::storage::types::{Person, SplitResult, TombstonedDeleteOutcome};
+use crate::storage::types::{
+ DeletePersonsMode, DeletePersonsOutcome, Person, SplitResult, TombstonedDeleteOutcome,
+};
/// Person lookup operations by ID, UUID, and distinct ID
#[async_trait]
@@ -51,12 +53,14 @@ pub trait PersonLookup: Send + Sync {
// Deletes
- /// Delete persons by UUID for a given team. Large batches are split into
- /// fixed-size chunks and deleted concurrently. Each chunk runs in its own
- /// transaction, deleting distinct_ids first (FK is NO ACTION) then persons
- /// (feature flag hash key overrides cascade at the DB level). Idempotent:
- /// deleting already-removed UUIDs is a no-op.
- async fn delete_persons(&self, team_id: i64, uuids: &[Uuid]) -> StorageResult<i64>;
+ /// `Hard` removes the rows, tombstoned ones included. `Tombstone` keeps
+ /// them and reports the versions written for the ClickHouse tombstones.
+ async fn delete_persons(
+ &self,
+ team_id: i64,
+ uuids: &[Uuid],
+ mode: DeletePersonsMode,
+ ) -> StorageResult<DeletePersonsOutcome>;
/// Delete persons that are still tombstoned, at most `max_rows` dependent rows per call:
/// persons that fit the budget go whole, the first that does not is trimmed with the leftover
diff --git a/rust/personhog-replica/src/storage/types/person.rs b/rust/personhog-replica/src/storage/types/person.rs
index eabb3ad89f3d..b4ecd738f10b 100644
--- a/rust/personhog-replica/src/storage/types/person.rs
+++ b/rust/personhog-replica/src/storage/types/person.rs
@@ -16,6 +16,36 @@ pub struct DistinctIdWithVersion {
pub id: i64,
}
+/// How DeletePersons removes rows. A caller that publishes ClickHouse tombstones
+/// asks for `Tombstone` and reads the versions back; everything else hard-deletes.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub enum DeletePersonsMode {
+ Hard,
+ Tombstone,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct TombstonedDistinctId {
+ pub distinct_id: String,
+ pub version: i64,
+}
+
+/// The versions a tombstone wrote for one person, for the caller's ClickHouse
+/// tombstones.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct TombstonedPerson {
+ pub uuid: Uuid,
+ pub version: i64,
+ pub distinct_ids: Vec<TombstonedDistinctId>,
+}
+
+#[derive(Debug, Clone, Default, PartialEq, Eq)]
+pub struct DeletePersonsOutcome {
+ pub deleted: i64,
+ /// Set only when the rows were tombstoned.
+ pub tombstones: Option<Vec<TombstonedPerson>>,
+}
+
/// Outcome of one bounded DeleteTombstonedPersons call. Every requested uuid lands in at most
/// one bucket; a uuid with no Postgres row, or whose person is live again, lands in none.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
diff --git a/rust/personhog-replica/tests/service_tests.rs b/rust/personhog-replica/tests/service_tests.rs
index c9978d0b5bfb..fd9c40c8a41d 100644
--- a/rust/personhog-replica/tests/service_tests.rs
+++ b/rust/personhog-replica/tests/service_tests.rs
@@ -4,8 +4,8 @@ use common::TestContext;
use personhog_proto::personhog::replica::v1::person_hog_replica_server::PersonHogReplica;
use personhog_proto::personhog::types::v1::{
CheckCohortMembershipRequest, CountGroupTypeMappingsRequest,
- DeleteHashKeyOverridesByTeamsRequest, DeletePersonsBatchForTeamRequest,
- DeleteTombstonedPersonsRequest, GetDistinctIdsForPersonRequest,
+ DeleteHashKeyOverridesByTeamsRequest, DeletePersonsBatchForTeamRequest, DeletePersonsMode,
+ DeletePersonsRequest, DeleteTombstonedPersonsRequest, GetDistinctIdsForPersonRequest,
GetDistinctIdsForPersonsRequest, GetGroupRequest, GetGroupTypeMappingsByProjectIdRequest,
GetGroupTypeMappingsByProjectIdsRequest, GetGroupTypeMappingsByTeamIdRequest,
GetGroupTypeMappingsByTeamIdsRequest, GetGroupsBatchRequest, GetGroupsRequest,
@@ -1427,6 +1427,68 @@ async fn test_delete_tombstoned_persons_reports_each_outcome(
ctx.cleanup().await.ok();
}
+#[tokio::test]
+async fn test_delete_persons_tombstone_mode_reports_versions() {
+ let ctx = ServiceTestContext::new().await;
+ let person = ctx.insert_person("svc_tomb_mode", None).await.unwrap();
+
+ let response = ctx
+ .service
+ .delete_persons(Request::new(DeletePersonsRequest {
+ team_id: ctx.team_id,
+ person_uuids: vec![person.uuid.to_string()],
+ mode: DeletePersonsMode::Tombstone as i32,
+ }))
+ .await
+ .expect("RPC failed")
+ .into_inner();
+
+ assert_eq!(response.deleted_count, 1);
+ assert!(response.tombstoned);
+ assert_eq!(response.tombstones.len(), 1);
+ assert_eq!(response.tombstones[0].person_uuid, person.uuid.to_string());
+ assert_eq!(response.tombstones[0].version, 1);
+ assert_eq!(response.tombstones[0].distinct_ids.len(), 1);
+ assert_eq!(
+ response.tombstones[0].distinct_ids[0].distinct_id,
+ "svc_tomb_mode"
+ );
+ assert_eq!(response.tombstones[0].distinct_ids[0].version, 1);
+
+ // A hard delete reports no versions and removes the tombstone.
+ let response = ctx
+ .service
+ .delete_persons(Request::new(DeletePersonsRequest {
+ team_id: ctx.team_id,
+ person_uuids: vec![person.uuid.to_string()],
+ mode: DeletePersonsMode::Hard as i32,
+ }))
+ .await
+ .expect("RPC failed")
+ .into_inner();
+ assert_eq!(response.deleted_count, 1);
+ assert!(!response.tombstoned);
+ assert!(response.tombstones.is_empty());
+
+ ctx.cleanup().await.ok();
+}
+
+#[tokio::test]
+async fn test_delete_persons_rejects_an_unknown_mode() {
+ let ctx = ServiceTestContext::new().await;
+ let status = ctx
+ .service
+ .delete_persons(Request::new(DeletePersonsRequest {
+ team_id: ctx.team_id,
+ person_uuids: vec![Uuid::now_v7().to_string()],
+ mode: 99,
+ }))
+ .await
+ .unwrap_err();
+ assert_eq!(status.code(), tonic::Code::InvalidArgument);
+ ctx.cleanup().await.ok();
+}
+
#[tokio::test]
async fn test_delete_persons_batch_for_team() {
let ctx = ServiceTestContext::new().await;
diff --git a/rust/personhog-replica/tests/storage_tests.rs b/rust/personhog-replica/tests/storage_tests.rs
index d54691c571b9..ec1cc0fa7087 100644
--- a/rust/personhog-replica/tests/storage_tests.rs
+++ b/rust/personhog-replica/tests/storage_tests.rs
@@ -3,7 +3,9 @@ mod common;
use common::TestContext;
use metrics_util::debugging::{DebugValue, DebuggingRecorder, Snapshotter};
use personhog_replica::storage::postgres::ConsistencyLevel;
-use personhog_replica::storage::{GroupKey, TombstonedDeleteOutcome};
+use personhog_replica::storage::{
+ DeletePersonsMode, GroupKey, TombstonedDeleteOutcome, TombstonedDistinctId, TombstonedPerson,
+};
use rand::Rng;
use rstest::rstest;
use std::time::{Duration, Instant};
@@ -396,9 +398,10 @@ async fn test_delete_persons_clears_cohort_memberships() {
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[person.uuid])
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Hard)
.await
- .expect("delete persons");
+ .expect("delete persons")
+ .deleted;
assert_eq!(deleted, 1);
assert_eq!(
@@ -409,6 +412,266 @@ async fn test_delete_persons_clears_cohort_memberships() {
ctx.cleanup().await.ok();
}
+async fn tombstone_state(
+ pool: &sqlx::PgPool,
+ team_id: i64,
+ person_id: i64,
+) -> (bool, i64, serde_json::Value, Vec<(bool, i64)>) {
+ let (is_deleted, version, properties): (bool, i64, serde_json::Value) = sqlx::query_as(
+ "SELECT is_deleted, version, properties FROM posthog_person WHERE team_id = $1 AND id = $2",
+ )
+ .bind(team_id)
+ .bind(person_id)
+ .fetch_one(pool)
+ .await
+ .expect("person row should still exist");
+ let distinct_ids: Vec<(bool, i64)> = sqlx::query_as(
+ "SELECT is_deleted, version FROM posthog_persondistinctid WHERE team_id = $1 AND person_id = $2 ORDER BY id",
+ )
+ .bind(team_id)
+ .bind(person_id)
+ .fetch_all(pool)
+ .await
+ .unwrap();
+ (is_deleted, version, properties, distinct_ids)
+}
+
+async fn hash_key_override_count(pool: &sqlx::PgPool, team_id: i64, person_id: i64) -> i64 {
+ sqlx::query_scalar(
+ "SELECT count(*) FROM posthog_featureflaghashkeyoverride WHERE team_id = $1 AND person_id = $2",
+ )
+ .bind(team_id)
+ .bind(person_id)
+ .fetch_one(pool)
+ .await
+ .unwrap()
+}
+
+#[tokio::test]
+async fn test_delete_persons_tombstone_mode_keeps_the_rows() {
+ let ctx = TestContext::new().await;
+ let cohort_id: i64 = 8802;
+ let person = ctx
+ .insert_person(
+ Some(serde_json::json!({"email": "[email protected]"})),
+ )
+ .await
+ .unwrap();
+ ctx.add_distinct_id_to_person(person.id, "tombstone_b")
+ .await
+ .unwrap();
+ ctx.add_person_to_cohort(person.id, cohort_id)
+ .await
+ .unwrap();
+ ctx.insert_hash_key_override(person.id, "flag", "hash")
+ .await
+ .unwrap();
+
+ let deleted = ctx
+ .storage
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Tombstone)
+ .await
+ .expect("delete persons")
+ .deleted;
+ assert_eq!(deleted, 1);
+
+ // The rows survive as tombstones: the counter continued from 0 to 1 on
+ // every row and the properties are gone.
+ let (is_deleted, version, properties, distinct_ids) =
+ tombstone_state(&ctx.pool, ctx.team_id, person.id).await;
+ assert!(is_deleted);
+ assert_eq!(version, 1);
+ assert_eq!(properties, serde_json::json!({}));
+ assert_eq!(distinct_ids, vec![(true, 1), (true, 1)]);
+ assert_eq!(
+ cohort_row_count(&ctx.pool, cohort_id, &[person.id]).await,
+ 0
+ );
+ assert_eq!(
+ hash_key_override_count(&ctx.pool, ctx.team_id, person.id).await,
+ 0
+ );
+
+ // Reads treat a tombstone as absent.
+ assert!(ctx
+ .storage
+ .get_person_by_id(ctx.team_id, person.id)
+ .await
+ .unwrap()
+ .is_none());
+ assert!(ctx
+ .storage
+ .get_person_by_distinct_id(ctx.team_id, "tombstone_b")
+ .await
+ .unwrap()
+ .is_none());
+
+ // Deleting again is a no-op: no second version bump.
+ let deleted = ctx
+ .storage
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Tombstone)
+ .await
+ .unwrap()
+ .deleted;
+ assert_eq!(deleted, 0);
+ let (_, version, _, _) = tombstone_state(&ctx.pool, ctx.team_id, person.id).await;
+ assert_eq!(version, 1);
+
+ ctx.cleanup().await.ok();
+}
+
+#[tokio::test]
+async fn test_delete_persons_tombstone_mode_reports_the_versions() {
+ let ctx = TestContext::new().await;
+ let person = ctx.insert_person("versions_a", None).await.unwrap();
+ ctx.add_distinct_id_to_person(person.id, "versions_b")
+ .await
+ .unwrap();
+
+ let outcome = ctx
+ .storage
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Tombstone)
+ .await
+ .unwrap();
+
+ assert_eq!(outcome.deleted, 1);
+ // The versions the caller publishes to ClickHouse: exactly what the rows now hold.
+ assert_eq!(
+ outcome.tombstones,
+ Some(vec![TombstonedPerson {
+ uuid: person.uuid,
+ version: 1,
+ distinct_ids: vec![
+ TombstonedDistinctId {
+ distinct_id: "versions_a".to_string(),
+ version: 1,
+ },
+ TombstonedDistinctId {
+ distinct_id: "versions_b".to_string(),
+ version: 1,
+ },
+ ],
+ }])
+ );
+ let (is_deleted, version, _, _) = tombstone_state(&ctx.pool, ctx.team_id, person.id).await;
+ assert!(is_deleted);
+ assert_eq!(version, 1);
+
+ ctx.cleanup().await.ok();
+}
+
+#[tokio::test]
+async fn test_delete_persons_tombstone_mode_reports_versions_again_on_retry() {
+ let ctx = TestContext::new().await;
+ let person = ctx.insert_person("retry_versions", None).await.unwrap();
+ let live = ctx.insert_person("retry_live", None).await.unwrap();
+
+ let first = ctx
+ .storage
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Tombstone)
+ .await
+ .unwrap();
+ // A caller that lost the first response must get the same versions back, or
+ // its ClickHouse tombstones never get published. A live person in the same
+ // request is tombstoned and counted; the earlier one is reported, not counted.
+ let retry = ctx
+ .storage
+ .delete_persons(
+ ctx.team_id,
+ &[person.uuid, live.uuid],
+ DeletePersonsMode::Tombstone,
+ )
+ .await
+ .unwrap();
+
+ assert_eq!(first.deleted, 1);
+ assert_eq!(retry.deleted, 1);
+ let mut expected = first.tombstones.clone().unwrap();
+ expected.push(TombstonedPerson {
+ uuid: live.uuid,
+ version: 1,
+ distinct_ids: vec![TombstonedDistinctId {
+ distinct_id: "retry_live".to_string(),
+ version: 1,
+ }],
+ });
+ expected.sort_by(|a, b| a.uuid.cmp(&b.uuid));
+ assert_eq!(retry.tombstones, Some(expected));
+
+ ctx.cleanup().await.ok();
+}
+
+#[tokio::test]
+async fn test_delete_persons_hard_mode_reports_no_versions() {
+ let ctx = TestContext::new().await;
+ let person = ctx.insert_person("hard_mode", None).await.unwrap();
+
+ let outcome = ctx
+ .storage
+ .delete_persons(ctx.team_id, &[person.uuid], DeletePersonsMode::Hard)
+ .await
+ .unwrap();
+
+ assert_eq!(outcome.deleted, 1);
+ assert_eq!(outcome.tombstones, None);
+ assert!(!ctx.person_row_exists(person.id).await.unwrap());
+
+ ctx.cleanup().await.ok();
+}
+
+#[tokio::test]
+async fn test_delete_persons_batch_for_team_removes_tombstoned_rows() {
+ let ctx = TestContext::new().await;
+ let live = ctx.insert_person("batch_live", None).await.unwrap();
+ let tombstoned = ctx.insert_person("batch_tombstoned", None).await.unwrap();
+ ctx.storage
+ .delete_persons(
+ ctx.team_id,
+ &[tombstoned.uuid],
+ DeletePersonsMode::Tombstone,
+ )
+ .await
+ .unwrap();
+ let (is_deleted, _, _, _) = tombstone_state(&ctx.pool, ctx.team_id, tombstoned.id).await;
+ assert!(is_deleted);
+
+ // Team teardown removes every row, tombstoned or not, and terminates.
+ let mut counts = Vec::new();
+ for _ in 0..2 {
+ counts.push(
+ ctx.storage
+ .delete_persons_batch_for_team(ctx.team_id, 10)
+ .await
+ .unwrap(),
+ );
+ }
+ assert_eq!(counts, vec![2, 0]);
+
+ for person in [&live, &tombstoned] {
+ let remaining: i64 = sqlx::query_scalar(
+ "SELECT count(*) FROM posthog_person WHERE team_id = $1 AND id = $2",
+ )
+ .bind(ctx.team_id)
+ .bind(person.id)
+ .fetch_one(&ctx.pool)
+ .await
+ .unwrap();
+ assert_eq!(remaining, 0);
+ let mappings: i64 = sqlx::query_scalar(
+ "SELECT count(*) FROM posthog_persondistinctid WHERE team_id = $1 AND person_id = $2",
+ )
+ .bind(ctx.team_id)
+ .bind(person.id)
+ .fetch_one(&ctx.pool)
+ .await
+ .unwrap();
+ assert_eq!(mappings, 0);
+ }
+
+ ctx.cleanup().await.ok();
+}
+
#[tokio::test]
async fn test_delete_persons_batch_for_team_leaves_cohort_memberships() {
// The team-teardown path clears cohortpeople separately, by cohort, before
@@ -1378,9 +1641,10 @@ async fn test_delete_persons_small_batch() {
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid])
+ .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 2);
@@ -1432,9 +1696,10 @@ async fn test_delete_persons_empty_uuids() {
let ctx = TestContext::new().await;
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[])
+ .delete_persons(ctx.team_id, &[], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 0);
ctx.cleanup().await.ok();
}
@@ -1444,9 +1709,14 @@ async fn test_delete_persons_nonexistent_uuids() {
let ctx = TestContext::new().await;
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[Uuid::now_v7(), Uuid::now_v7()])
+ .delete_persons(
+ ctx.team_id,
+ &[Uuid::now_v7(), Uuid::now_v7()],
+ DeletePersonsMode::Hard,
+ )
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 0);
ctx.cleanup().await.ok();
}
@@ -1465,9 +1735,10 @@ async fn test_delete_persons_with_multiple_distinct_ids() {
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[p1.uuid])
+ .delete_persons(ctx.team_id, &[p1.uuid], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 1);
@@ -1518,9 +1789,10 @@ async fn test_delete_persons_large_batch_triggers_parallel() {
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &uuids)
+ .delete_persons(ctx.team_id, &uuids, DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 150);
@@ -1595,17 +1867,19 @@ async fn test_delete_persons_idempotent() {
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid])
+ .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 2);
// Second call with the same UUIDs should be a no-op
let deleted_again = ctx
.storage
- .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid])
+ .delete_persons(ctx.team_id, &[p1.uuid, p2.uuid], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted_again, 0);
ctx.cleanup().await.ok();
@@ -1639,9 +1913,10 @@ async fn test_delete_persons_cross_team_isolation() {
// Delete from ctx.team_id — should not touch the other team's person
let deleted = ctx
.storage
- .delete_persons(ctx.team_id, &[p1.uuid, other_uuid])
+ .delete_persons(ctx.team_id, &[p1.uuid, other_uuid], DeletePersonsMode::Hard)
.await
- .expect("Failed to delete persons");
+ .expect("Failed to delete persons")
+ .deleted;
assert_eq!(deleted, 1);
// Other team's person should still exist
@@ -1695,7 +1970,11 @@ async fn test_delete_persons_partial_failure_returns_error() {
// The call should return an error because the FK blocks deletion
let result = ctx
.storage
- .delete_persons(ctx.team_id, &[blocked.uuid, normal.uuid])
+ .delete_persons(
+ ctx.team_id,
+ &[blocked.uuid, normal.uuid],
+ DeletePersonsMode::Hard,
+ )
.await;
assert!(result.is_err(), "Expected error due to blocked FK");
diff --git a/rust/personhog-router/tests/common/mod.rs b/rust/personhog-router/tests/common/mod.rs
index 03d33bda3e29..4bc7ecb759a2 100644
--- a/rust/personhog-router/tests/common/mod.rs
+++ b/rust/personhog-router/tests/common/mod.rs
@@ -466,7 +466,11 @@ impl PersonHogReplica for TestReplicaService {
&self,
_request: Request<DeletePersonsRequest>,
) -> Result<Response<DeletePersonsResponse>, Status> {
- Ok(Response::new(DeletePersonsResponse { deleted_count: 0 }))
+ Ok(Response::new(DeletePersonsResponse {
+ deleted_count: 0,
+ tombstoned: false,
+ tombstones: vec![],
+ }))
}
async fn delete_persons_batch_for_team(
diff --git a/rust/personhog-router/tests/raw_proxy_integration.rs b/rust/personhog-router/tests/raw_proxy_integration.rs
index 67d438e36e84..c8d5d3c13640 100644
--- a/rust/personhog-router/tests/raw_proxy_integration.rs
+++ b/rust/personhog-router/tests/raw_proxy_integration.rs
@@ -257,6 +257,7 @@ async fn raw_proxy_delete_persons_routes_to_replica() {
.delete_persons(DeletePersonsRequest {
team_id: 1,
person_uuids: vec!["00000000-0000-0000-0000-000000000042".to_string()],
+ mode: 0,
})
.await;