From be6a1131641786fb25e413807ec601138ebc3417 Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Tue, 12 Nov 2024 16:35:32 -0700 Subject: [PATCH 1/2] Update documentation of BulkImportRelationshipsRequest --- authzed/api/v1/permission_service.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authzed/api/v1/permission_service.proto b/authzed/api/v1/permission_service.proto index 8716af0..93d06c1 100644 --- a/authzed/api/v1/permission_service.proto +++ b/authzed/api/v1/permission_service.proto @@ -670,7 +670,9 @@ message ResolvedSubject { // ImportBulkRelationshipsRequest represents one batch of the streaming // ImportBulkRelationships API. The maximum size is only limited by the backing // datastore, and optimal size should be determined by the calling client -// experimentally. +// experimentally. Any relationships within the same request are guaranteed to +// be written in a single transaction. If any of the relationships already +// exist, the transaction will fail and no relationships will be written. message ImportBulkRelationshipsRequest { repeated Relationship relationships = 1 [ (validate.rules).repeated .items.message.required = true ]; From 0196957f176a1988368defa6b009ac524fd72afa Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Wed, 13 Nov 2024 10:11:23 -0700 Subject: [PATCH 2/2] Update verbiate --- authzed/api/v1/experimental_service.proto | 7 ++++--- authzed/api/v1/permission_service.proto | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/authzed/api/v1/experimental_service.proto b/authzed/api/v1/experimental_service.proto index daad46f..d261f1d 100644 --- a/authzed/api/v1/experimental_service.proto +++ b/authzed/api/v1/experimental_service.proto @@ -222,9 +222,10 @@ message BulkCheckPermissionResponseItem { // BulkImportRelationshipsRequest represents one batch of the streaming // BulkImportRelationships API. The maximum size is only limited by the backing // datastore, and optimal size should be determined by the calling client -// experimentally. Any relationships within the same request are guaranteed to -// be written in a single transaction. If any of the relationships already -// exist, the transaction will fail and no relationships will be written. +// experimentally. When BulkImport is invoked and receives its first request message, +// a transaction is opened to import the relationships. All requests sent to the same +// invocation are executed under this single transaction. If a relationship already +// exists within the datastore, the entire transaction will fail with an error. message BulkImportRelationshipsRequest { repeated Relationship relationships = 1 [ (validate.rules).repeated .items.message.required = true ]; diff --git a/authzed/api/v1/permission_service.proto b/authzed/api/v1/permission_service.proto index 93d06c1..5e1b453 100644 --- a/authzed/api/v1/permission_service.proto +++ b/authzed/api/v1/permission_service.proto @@ -670,9 +670,10 @@ message ResolvedSubject { // ImportBulkRelationshipsRequest represents one batch of the streaming // ImportBulkRelationships API. The maximum size is only limited by the backing // datastore, and optimal size should be determined by the calling client -// experimentally. Any relationships within the same request are guaranteed to -// be written in a single transaction. If any of the relationships already -// exist, the transaction will fail and no relationships will be written. +// experimentally. When ImportBulk is invoked and receives its first request message, +// a transaction is opened to import the relationships. All requests sent to the same +// invocation are executed under this single transaction. If a relationship already +// exists within the datastore, the entire transaction will fail with an error. message ImportBulkRelationshipsRequest { repeated Relationship relationships = 1 [ (validate.rules).repeated .items.message.required = true ];