diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 597432d..f677896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,8 +147,8 @@ jobs: qualification: name: External test suite - uses: batchstream/sink-production-suite/.github/workflows/server-qualification.yml@e6e4058ba7d05aef6154f348526c86acc109ff1c + uses: batchstream/sink-production-suite/.github/workflows/server-qualification.yml@959a7e74d77f308e7167878ab175f4266c7ee11f with: - suite_ref: e6e4058ba7d05aef6154f348526c86acc109ff1c + suite_ref: 959a7e74d77f308e7167878ab175f4266c7ee11f sink_ref: ${{ github.event.pull_request.head.sha || github.sha }} sdk_ref: ${{ github.head_ref || 'main' }} diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index 78101ef..e233f03 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -20,9 +20,9 @@ env: jobs: qualify: name: Public production qualification - uses: batchstream/sink-production-suite/.github/workflows/release-qualification.yml@e6e4058ba7d05aef6154f348526c86acc109ff1c + uses: batchstream/sink-production-suite/.github/workflows/release-qualification.yml@959a7e74d77f308e7167878ab175f4266c7ee11f with: - suite_ref: e6e4058ba7d05aef6154f348526c86acc109ff1c + suite_ref: 959a7e74d77f308e7167878ab175f4266c7ee11f sink_ref: ${{ github.event.release.tag_name }} binaries: diff --git a/.github/workflows/reliability.yml b/.github/workflows/reliability.yml index 9f4e9ea..e9b16d3 100644 --- a/.github/workflows/reliability.yml +++ b/.github/workflows/reliability.yml @@ -8,7 +8,7 @@ permissions: jobs: soak: - uses: batchstream/sink-production-suite/.github/workflows/reliability.yml@e6e4058ba7d05aef6154f348526c86acc109ff1c + uses: batchstream/sink-production-suite/.github/workflows/reliability.yml@959a7e74d77f308e7167878ab175f4266c7ee11f with: - suite_ref: e6e4058ba7d05aef6154f348526c86acc109ff1c + suite_ref: 959a7e74d77f308e7167878ab175f4266c7ee11f sink_ref: ${{ github.sha }} diff --git a/configs/stores/primary.yaml b/configs/stores/primary.yaml index 6dd03be..4ba1630 100644 --- a/configs/stores/primary.yaml +++ b/configs/stores/primary.yaml @@ -7,8 +7,6 @@ storage: uri: mongodb://mongodb:27017 # Example endpoint; required unless uri_file is set. # uri_file: /etc/sink-secrets/mongodb-uri # Omit uri when using its file alternative. metadata_field: __sink # Must match across roles and replicas. - max_concurrent_writes: 64 # Per process; shared by Engine and Worker configuration. - max_concurrent_groups: 16 # For elasticsearch/opensearch, replace mongodb with search: # search: # endpoints: [http://opensearch:9200] diff --git a/docs/configuration.md b/docs/configuration.md index aa04b53..9e027d2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -77,8 +77,6 @@ storage: mongodb: uri: mongodb://mongodb:27017 metadata_field: __sink - max_concurrent_writes: 64 - max_concurrent_groups: 16 kafka: enabled: true brokers: [kafka:9092] @@ -144,8 +142,6 @@ use the lowercase spelling shown below. Storage names are also case-sensitive. | `storage.driver` | enum string | Yes | none | `mongodb`, `elasticsearch`, `opensearch` | Adapter used by this storage instance. See [Storage driver values](#storage-driver-values). | | `storage.mongodb.uri` | string | Conditionally | none | Valid MongoDB connection string | Required when the entry's driver is `mongodb`. | | `storage.mongodb.metadata_field` | string | No | `__sink` | Any valid MongoDB field except `_id`; cannot contain `.`, `$`, or a null byte | Reserved top-level field where Sink stores internal metadata such as the record revision; removed from documents returned to clients. | -| `storage.mongodb.max_concurrent_writes` | positive integer | No | `64` | Integer greater than `0` | Maximum concurrent MongoDB conditional writes. | -| `storage.mongodb.max_concurrent_groups` | positive integer | No | `16` | Integer greater than `0` | Maximum collection groups executed concurrently across all calls to one store. | | `storage.search.endpoints` | list of strings | Conditionally | none | One or more HTTP(S) endpoints | Required for `elasticsearch` and `opensearch`. | | `storage.search.username` | string | Conditionally | empty | Any username accepted by the search service | Basic-auth username. Must be configured together with `password`. | | `storage.search.password` | string | Conditionally | empty | Any password accepted by the search service | Basic-auth password. Must be configured together with `username`. | diff --git a/docs/development.md b/docs/development.md index a4978d8..6de0444 100644 --- a/docs/development.md +++ b/docs/development.md @@ -158,7 +158,7 @@ result reduced median allocated bytes as follows (five samples): | MongoDB | 64 KiB | 386,795 | 306,979 | 20.6% | | MongoDB | 1 MiB | 5,909,091 | 4,576,522 | 22.6% | -Repeated results still own separate mutable documents and revisions. The read +Repeated storage results still own separate mutable documents and internal revisions. The read measurements include the local harness and do not establish database throughput. Encoding queue messages directly into their final envelope reduced allocations from two to one and allocated bytes by 50% for 4 KiB, 64 KiB, and 1 MiB payloads. diff --git a/docs/merge-folding.md b/docs/merge-folding.md index 22eb52a..66f4e75 100644 --- a/docs/merge-folding.md +++ b/docs/merge-folding.md @@ -21,7 +21,7 @@ own boundary. See [record addresses](record-addresses.md). | One Create or Replace | One direct conditional write, as before | | Repeated Create/Replace/Upsert, or Put mixed with Merge | Read once, evaluate in order, commit the final successful document once | | Merge only | Read once, execute each Lua program in order, commit once | -| Write requesting `return_document` | Commit that operation independently and return its own logical document and revision; other operations may still fold | +| Write requesting `return_document` | Commit that operation independently and return its own logical document; other operations may still fold | | Repeated Read | Fetch once, return separate result objects from that observation | | Repeated synchronous Delete | Delete once, return the same outcome to every operation | @@ -41,7 +41,7 @@ The folding rules below apply to operations that share a commit. `return_document` guarantees an independent commit for the operation carrying the option, retaining the batcher's ordering barrier. It does not guarantee separate commits for every other operation in the same-address chain. A trailing -run without returned documents may still fold and share a revision. Only APPLIED +run without returned documents may still fold into one commit. Only APPLIED operations requesting a document receive one. Asynchronous completion rejects this option. Returned documents are the logical Put/Merge outputs; backend-generated fields and ingest transformations are excluded. See [returned writes](native-access.md#returned-writes). @@ -56,8 +56,8 @@ and ingest transformations are excluded. See [returned writes](native-access.md# 4. A failed condition or Lua program leaves the working state unchanged. Commit the final successful document using the original snapshot's revision, or a record-not-exists condition for an initially absent document. -5. After a successful commit, successful operations return APPLIED with the - same final revision. Preserve the individually evaluated failures and original +5. After a successful commit, successful operations return APPLIED. The revision + remains internal to Sink. Preserve the individually evaluated failures and original operation indexes/RPC boundaries. If no operation succeeds, return the evaluated failures without writing. @@ -101,7 +101,7 @@ requirements still apply; folding does not provide exactly-once execution or batch transactions. Reads share one backend observation per address but produce independent payload -and revision copies. Every streamed result, including repetitions, must fit its +copies. Every streamed result, including repetitions, must fit its own message ceiling. Internal batch callers retain their local response limits. The backend's unique-document read remains bounded by the active microbatch. Missing/error results are returned to all matching operations. @@ -136,7 +136,7 @@ conflict recomputation, failed/lost commits, output and admission bounds, read response copies and repeated-key budgets, full address isolation, cross-RPC folding, and preservation of asynchronous intents. Existing completion-mode and cancellation regressions remain applicable. Tagged MongoDB/Search integration -cases exercise mixed writes, final revisions, BSON dates, and search visibility. +cases exercise mixed writes, final committed state, BSON dates, and search visibility. Additional regressions cover multiline Bulk JSON, bounded Replace revision retries (including unknown acknowledgements and successful siblings), per-RPC budget isolation, memory-limited splitting, and cross-batch dependencies and @@ -213,7 +213,7 @@ Reproduce with `GOMAXPROCS=4 go test ./internal/service -run '^$' benchmark and test helpers into a detached baseline worktree. Race tests separately cover concurrent servers, whole-run conflict retries, cancellation, failed commits, and lost acknowledgements. Tagged integration tests check real backend visibility, -concurrent folded updates, shared revisions, and BSON types. +concurrent folded updates, shared commits, and BSON types. ### Contended commits diff --git a/docs/native-access.md b/docs/native-access.md index ab5cf94..d580239 100644 --- a/docs/native-access.md +++ b/docs/native-access.md @@ -405,20 +405,21 @@ retries. Older servers without the detail keep single-attempt behavior. Set `WriteOperation.return_document` (SDK `WithReturnedDocument()` or `Record.ReturnDocument`) to receive the operation's logical Put/Merge document -alongside its successful revision. Only APPLIED results include documents. +after its successful commit. Only APPLIED results include documents. +Record revisions remain internal to Sink and are not returned by Read or Write. `RETURN_AFTER_ACCEPTED` with this option is rejected before publishing anything; use `WAIT_UNTIL_APPLIED` or `WAIT_UNTIL_VISIBLE`. Sink takes the document from the successful commit candidate, never from a later Read. Every operation requesting a returned document commits independently of preceding and following operations. Other operations can still share a folded -commit and revision; setting the option on one operation does not promise +commit; setting the option on one operation does not promise independent commits for the entire same-address chain. For three increments -where only the first requests a document, the first can return value 1 and -revision A while the remaining two share the commit of value 3 and revision B. -Request a document on each operation when each needs its own committed output -and revision. A conflicting attempt's speculative output is not returned. A -definite CAS conflict may recompute against a fresh snapshot; transport failures +where only the first requests a document, the first can return value 1 while +the remaining two share the commit of value 3. +Request a document on each operation when each needs its own committed output. +A conflicting attempt's speculative output is not returned. A definite CAS +conflict may recompute against a fresh snapshot; transport failures and unknown commit outcomes are not automatically replayed. The returned document is the logical document submitted to the backend. Sink diff --git a/docs/reliability.md b/docs/reliability.md index 84e34c3..64b27aa 100644 --- a/docs/reliability.md +++ b/docs/reliability.md @@ -60,7 +60,7 @@ retries safe. Returned-document chains execute in ordered rounds: independent direct Puts commit before a round starts conditional reads, without concurrent unbudgeted -snapshots. Each returned operation retains its own committed revision/document. +snapshots. Each returned operation retains its own committed document. Scan has separate byte, request and per-store sublimits in addition to global admission. Defaults reserve half the configured capacity for ordinary work (count limits round up to one for a total limit of one). Two default BSON scans diff --git a/examples/kubernetes/sink.yaml b/examples/kubernetes/sink.yaml index 263a683..9d14489 100644 --- a/examples/kubernetes/sink.yaml +++ b/examples/kubernetes/sink.yaml @@ -4,7 +4,6 @@ grpc: {address: ":8080", max_receive_message_bytes: 64MiB, max_send_message_byte health: {address: ":8081"} prometheus: {enabled: true, address: ":9090"} execution: - mongodb: {max_concurrent_writes: 64, max_concurrent_groups: 16} merge: {max_attempts: 3} batching: max_wait: 2ms diff --git a/examples/quickstart/store.yaml b/examples/quickstart/store.yaml index fa51d7f..814579c 100644 --- a/examples/quickstart/store.yaml +++ b/examples/quickstart/store.yaml @@ -7,8 +7,6 @@ storage: uri: mongodb://mongo:27017/?replicaSet=rs0 # Example endpoint; required unless uri_file is set. # uri_file: /etc/sink-secrets/mongodb-uri # Omit uri when using its file alternative. metadata_field: __sink # Must match across roles and replicas. - max_concurrent_writes: 64 # Per process; shared by Engine and Worker configuration. - max_concurrent_groups: 16 # For elasticsearch/opensearch, replace mongodb with search: # search: # endpoints: [http://opensearch:9200] diff --git a/gen/sink/sink.pb.go b/gen/sink/sink.pb.go index f279823..2964919 100644 --- a/gen/sink/sink.pb.go +++ b/gen/sink/sink.pb.go @@ -510,51 +510,6 @@ func (x *Document) GetPayload() []byte { return nil } -// RevisionToken is interpreted only by the selected storage adapter. -type RevisionToken struct { - state protoimpl.MessageState `protogen:"open.v1"` - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RevisionToken) Reset() { - *x = RevisionToken{} - mi := &file_sink_sink_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RevisionToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RevisionToken) ProtoMessage() {} - -func (x *RevisionToken) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RevisionToken.ProtoReflect.Descriptor instead. -func (*RevisionToken) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{2} -} - -func (x *RevisionToken) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - type ReadRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Operations []*ReadOperation `protobuf:"bytes,1,rep,name=operations,proto3" json:"operations,omitempty"` @@ -564,7 +519,7 @@ type ReadRequest struct { func (x *ReadRequest) Reset() { *x = ReadRequest{} - mi := &file_sink_sink_proto_msgTypes[3] + mi := &file_sink_sink_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -576,7 +531,7 @@ func (x *ReadRequest) String() string { func (*ReadRequest) ProtoMessage() {} func (x *ReadRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[3] + mi := &file_sink_sink_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -589,7 +544,7 @@ func (x *ReadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. func (*ReadRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{3} + return file_sink_sink_proto_rawDescGZIP(), []int{2} } func (x *ReadRequest) GetOperations() []*ReadOperation { @@ -608,7 +563,7 @@ type ReadOperation struct { func (x *ReadOperation) Reset() { *x = ReadOperation{} - mi := &file_sink_sink_proto_msgTypes[4] + mi := &file_sink_sink_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -620,7 +575,7 @@ func (x *ReadOperation) String() string { func (*ReadOperation) ProtoMessage() {} func (x *ReadOperation) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[4] + mi := &file_sink_sink_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -633,7 +588,7 @@ func (x *ReadOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadOperation.ProtoReflect.Descriptor instead. func (*ReadOperation) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{4} + return file_sink_sink_proto_rawDescGZIP(), []int{3} } func (x *ReadOperation) GetAddress() *RecordAddress { @@ -654,7 +609,7 @@ type ReadResponse struct { func (x *ReadResponse) Reset() { *x = ReadResponse{} - mi := &file_sink_sink_proto_msgTypes[5] + mi := &file_sink_sink_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -666,7 +621,7 @@ func (x *ReadResponse) String() string { func (*ReadResponse) ProtoMessage() {} func (x *ReadResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[5] + mi := &file_sink_sink_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -679,7 +634,7 @@ func (x *ReadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. func (*ReadResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{5} + return file_sink_sink_proto_rawDescGZIP(), []int{4} } func (x *ReadResponse) GetResults() []*ReadResult { @@ -694,7 +649,6 @@ type ReadResult struct { OperationIndex uint32 `protobuf:"varint,1,opt,name=operation_index,json=operationIndex,proto3" json:"operation_index,omitempty"` Status ReadStatus `protobuf:"varint,2,opt,name=status,proto3,enum=sink.v1.ReadStatus" json:"status,omitempty"` Document *Document `protobuf:"bytes,3,opt,name=document,proto3" json:"document,omitempty"` - Revision *RevisionToken `protobuf:"bytes,4,opt,name=revision,proto3" json:"revision,omitempty"` Failure *Failure `protobuf:"bytes,5,opt,name=failure,proto3" json:"failure,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -702,7 +656,7 @@ type ReadResult struct { func (x *ReadResult) Reset() { *x = ReadResult{} - mi := &file_sink_sink_proto_msgTypes[6] + mi := &file_sink_sink_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -714,7 +668,7 @@ func (x *ReadResult) String() string { func (*ReadResult) ProtoMessage() {} func (x *ReadResult) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[6] + mi := &file_sink_sink_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -727,7 +681,7 @@ func (x *ReadResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadResult.ProtoReflect.Descriptor instead. func (*ReadResult) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{6} + return file_sink_sink_proto_rawDescGZIP(), []int{5} } func (x *ReadResult) GetOperationIndex() uint32 { @@ -751,13 +705,6 @@ func (x *ReadResult) GetDocument() *Document { return nil } -func (x *ReadResult) GetRevision() *RevisionToken { - if x != nil { - return x.Revision - } - return nil -} - func (x *ReadResult) GetFailure() *Failure { if x != nil { return x.Failure @@ -780,7 +727,7 @@ type WriteRequest struct { func (x *WriteRequest) Reset() { *x = WriteRequest{} - mi := &file_sink_sink_proto_msgTypes[7] + mi := &file_sink_sink_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -792,7 +739,7 @@ func (x *WriteRequest) String() string { func (*WriteRequest) ProtoMessage() {} func (x *WriteRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[7] + mi := &file_sink_sink_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -805,7 +752,7 @@ func (x *WriteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. func (*WriteRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{7} + return file_sink_sink_proto_rawDescGZIP(), []int{6} } func (x *WriteRequest) GetCompletionMode() CompletionMode { @@ -847,7 +794,7 @@ type WriteOperation struct { func (x *WriteOperation) Reset() { *x = WriteOperation{} - mi := &file_sink_sink_proto_msgTypes[8] + mi := &file_sink_sink_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -859,7 +806,7 @@ func (x *WriteOperation) String() string { func (*WriteOperation) ProtoMessage() {} func (x *WriteOperation) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[8] + mi := &file_sink_sink_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -872,7 +819,7 @@ func (x *WriteOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteOperation.ProtoReflect.Descriptor instead. func (*WriteOperation) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{8} + return file_sink_sink_proto_rawDescGZIP(), []int{7} } func (x *WriteOperation) GetAddress() *RecordAddress { @@ -941,7 +888,7 @@ type PutOperation struct { func (x *PutOperation) Reset() { *x = PutOperation{} - mi := &file_sink_sink_proto_msgTypes[9] + mi := &file_sink_sink_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -953,7 +900,7 @@ func (x *PutOperation) String() string { func (*PutOperation) ProtoMessage() {} func (x *PutOperation) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[9] + mi := &file_sink_sink_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -966,7 +913,7 @@ func (x *PutOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use PutOperation.ProtoReflect.Descriptor instead. func (*PutOperation) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{9} + return file_sink_sink_proto_rawDescGZIP(), []int{8} } func (x *PutOperation) GetDocument() *Document { @@ -996,7 +943,7 @@ type MergeOperation struct { func (x *MergeOperation) Reset() { *x = MergeOperation{} - mi := &file_sink_sink_proto_msgTypes[10] + mi := &file_sink_sink_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1008,7 +955,7 @@ func (x *MergeOperation) String() string { func (*MergeOperation) ProtoMessage() {} func (x *MergeOperation) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[10] + mi := &file_sink_sink_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1021,7 +968,7 @@ func (x *MergeOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use MergeOperation.ProtoReflect.Descriptor instead. func (*MergeOperation) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{10} + return file_sink_sink_proto_rawDescGZIP(), []int{9} } func (x *MergeOperation) GetIncomingDocument() *Document { @@ -1054,7 +1001,7 @@ type LuaProgram struct { func (x *LuaProgram) Reset() { *x = LuaProgram{} - mi := &file_sink_sink_proto_msgTypes[11] + mi := &file_sink_sink_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1066,7 +1013,7 @@ func (x *LuaProgram) String() string { func (*LuaProgram) ProtoMessage() {} func (x *LuaProgram) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[11] + mi := &file_sink_sink_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1079,7 +1026,7 @@ func (x *LuaProgram) ProtoReflect() protoreflect.Message { // Deprecated: Use LuaProgram.ProtoReflect.Descriptor instead. func (*LuaProgram) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{11} + return file_sink_sink_proto_rawDescGZIP(), []int{10} } func (x *LuaProgram) GetSource() []byte { @@ -1107,7 +1054,7 @@ type WriteResponse struct { func (x *WriteResponse) Reset() { *x = WriteResponse{} - mi := &file_sink_sink_proto_msgTypes[12] + mi := &file_sink_sink_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1066,7 @@ func (x *WriteResponse) String() string { func (*WriteResponse) ProtoMessage() {} func (x *WriteResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[12] + mi := &file_sink_sink_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1132,7 +1079,7 @@ func (x *WriteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. func (*WriteResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{12} + return file_sink_sink_proto_rawDescGZIP(), []int{11} } func (x *WriteResponse) GetResults() []*WriteResult { @@ -1146,7 +1093,6 @@ type WriteResult struct { state protoimpl.MessageState `protogen:"open.v1"` OperationIndex uint32 `protobuf:"varint,1,opt,name=operation_index,json=operationIndex,proto3" json:"operation_index,omitempty"` Status WriteStatus `protobuf:"varint,2,opt,name=status,proto3,enum=sink.v1.WriteStatus" json:"status,omitempty"` - Revision *RevisionToken `protobuf:"bytes,3,opt,name=revision,proto3" json:"revision,omitempty"` Failure *Failure `protobuf:"bytes,4,opt,name=failure,proto3" json:"failure,omitempty"` Document *Document `protobuf:"bytes,5,opt,name=document,proto3" json:"document,omitempty"` unknownFields protoimpl.UnknownFields @@ -1155,7 +1101,7 @@ type WriteResult struct { func (x *WriteResult) Reset() { *x = WriteResult{} - mi := &file_sink_sink_proto_msgTypes[13] + mi := &file_sink_sink_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1167,7 +1113,7 @@ func (x *WriteResult) String() string { func (*WriteResult) ProtoMessage() {} func (x *WriteResult) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[13] + mi := &file_sink_sink_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1180,7 +1126,7 @@ func (x *WriteResult) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteResult.ProtoReflect.Descriptor instead. func (*WriteResult) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{13} + return file_sink_sink_proto_rawDescGZIP(), []int{12} } func (x *WriteResult) GetOperationIndex() uint32 { @@ -1197,13 +1143,6 @@ func (x *WriteResult) GetStatus() WriteStatus { return WriteStatus_WRITE_STATUS_UNSPECIFIED } -func (x *WriteResult) GetRevision() *RevisionToken { - if x != nil { - return x.Revision - } - return nil -} - func (x *WriteResult) GetFailure() *Failure { if x != nil { return x.Failure @@ -1229,7 +1168,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} - mi := &file_sink_sink_proto_msgTypes[14] + mi := &file_sink_sink_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1241,7 +1180,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[14] + mi := &file_sink_sink_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1254,7 +1193,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{14} + return file_sink_sink_proto_rawDescGZIP(), []int{13} } func (x *DeleteRequest) GetCompletionMode() CompletionMode { @@ -1280,7 +1219,7 @@ type DeleteOperation struct { func (x *DeleteOperation) Reset() { *x = DeleteOperation{} - mi := &file_sink_sink_proto_msgTypes[15] + mi := &file_sink_sink_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1292,7 +1231,7 @@ func (x *DeleteOperation) String() string { func (*DeleteOperation) ProtoMessage() {} func (x *DeleteOperation) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[15] + mi := &file_sink_sink_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1305,7 +1244,7 @@ func (x *DeleteOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteOperation.ProtoReflect.Descriptor instead. func (*DeleteOperation) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{15} + return file_sink_sink_proto_rawDescGZIP(), []int{14} } func (x *DeleteOperation) GetAddress() *RecordAddress { @@ -1324,7 +1263,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} - mi := &file_sink_sink_proto_msgTypes[16] + mi := &file_sink_sink_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1336,7 +1275,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[16] + mi := &file_sink_sink_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1349,7 +1288,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{16} + return file_sink_sink_proto_rawDescGZIP(), []int{15} } func (x *DeleteResponse) GetResults() []*DeleteResult { @@ -1370,7 +1309,7 @@ type DeleteResult struct { func (x *DeleteResult) Reset() { *x = DeleteResult{} - mi := &file_sink_sink_proto_msgTypes[17] + mi := &file_sink_sink_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1382,7 +1321,7 @@ func (x *DeleteResult) String() string { func (*DeleteResult) ProtoMessage() {} func (x *DeleteResult) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[17] + mi := &file_sink_sink_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1395,7 +1334,7 @@ func (x *DeleteResult) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResult.ProtoReflect.Descriptor instead. func (*DeleteResult) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{17} + return file_sink_sink_proto_rawDescGZIP(), []int{16} } func (x *DeleteResult) GetOperationIndex() uint32 { @@ -1430,7 +1369,7 @@ type Failure struct { func (x *Failure) Reset() { *x = Failure{} - mi := &file_sink_sink_proto_msgTypes[18] + mi := &file_sink_sink_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1442,7 +1381,7 @@ func (x *Failure) String() string { func (*Failure) ProtoMessage() {} func (x *Failure) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[18] + mi := &file_sink_sink_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1455,7 +1394,7 @@ func (x *Failure) ProtoReflect() protoreflect.Message { // Deprecated: Use Failure.ProtoReflect.Descriptor instead. func (*Failure) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{18} + return file_sink_sink_proto_rawDescGZIP(), []int{17} } func (x *Failure) GetCode() FailureCode { @@ -1508,7 +1447,7 @@ type Command struct { func (x *Command) Reset() { *x = Command{} - mi := &file_sink_sink_proto_msgTypes[19] + mi := &file_sink_sink_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1520,7 +1459,7 @@ func (x *Command) String() string { func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[19] + mi := &file_sink_sink_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1533,7 +1472,7 @@ func (x *Command) ProtoReflect() protoreflect.Message { // Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{19} + return file_sink_sink_proto_rawDescGZIP(), []int{18} } func (x *Command) GetUri() string { @@ -1595,7 +1534,7 @@ type Header struct { func (x *Header) Reset() { *x = Header{} - mi := &file_sink_sink_proto_msgTypes[20] + mi := &file_sink_sink_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1607,7 +1546,7 @@ func (x *Header) String() string { func (*Header) ProtoMessage() {} func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[20] + mi := &file_sink_sink_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1620,7 +1559,7 @@ func (x *Header) ProtoReflect() protoreflect.Message { // Deprecated: Use Header.ProtoReflect.Descriptor instead. func (*Header) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{20} + return file_sink_sink_proto_rawDescGZIP(), []int{19} } func (x *Header) GetName() string { @@ -1656,7 +1595,7 @@ type ExecuteRequest struct { func (x *ExecuteRequest) Reset() { *x = ExecuteRequest{} - mi := &file_sink_sink_proto_msgTypes[21] + mi := &file_sink_sink_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1668,7 +1607,7 @@ func (x *ExecuteRequest) String() string { func (*ExecuteRequest) ProtoMessage() {} func (x *ExecuteRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[21] + mi := &file_sink_sink_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1681,7 +1620,7 @@ func (x *ExecuteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead. func (*ExecuteRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{21} + return file_sink_sink_proto_rawDescGZIP(), []int{20} } func (x *ExecuteRequest) GetCommand() *Command { @@ -1712,7 +1651,7 @@ type ExecuteResponse struct { func (x *ExecuteResponse) Reset() { *x = ExecuteResponse{} - mi := &file_sink_sink_proto_msgTypes[22] + mi := &file_sink_sink_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1724,7 +1663,7 @@ func (x *ExecuteResponse) String() string { func (*ExecuteResponse) ProtoMessage() {} func (x *ExecuteResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[22] + mi := &file_sink_sink_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1737,7 +1676,7 @@ func (x *ExecuteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead. func (*ExecuteResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{22} + return file_sink_sink_proto_rawDescGZIP(), []int{21} } func (x *ExecuteResponse) GetContentType() string { @@ -1802,7 +1741,7 @@ type QueryRequest struct { func (x *QueryRequest) Reset() { *x = QueryRequest{} - mi := &file_sink_sink_proto_msgTypes[23] + mi := &file_sink_sink_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1814,7 +1753,7 @@ func (x *QueryRequest) String() string { func (*QueryRequest) ProtoMessage() {} func (x *QueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[23] + mi := &file_sink_sink_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1827,7 +1766,7 @@ func (x *QueryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead. func (*QueryRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{23} + return file_sink_sink_proto_rawDescGZIP(), []int{22} } func (x *QueryRequest) GetCommand() *Command { @@ -1875,7 +1814,7 @@ type SortField struct { func (x *SortField) Reset() { *x = SortField{} - mi := &file_sink_sink_proto_msgTypes[24] + mi := &file_sink_sink_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1887,7 +1826,7 @@ func (x *SortField) String() string { func (*SortField) ProtoMessage() {} func (x *SortField) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[24] + mi := &file_sink_sink_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1900,7 +1839,7 @@ func (x *SortField) ProtoReflect() protoreflect.Message { // Deprecated: Use SortField.ProtoReflect.Descriptor instead. func (*SortField) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{24} + return file_sink_sink_proto_rawDescGZIP(), []int{23} } func (x *SortField) GetField() string { @@ -1931,7 +1870,7 @@ type Projection struct { func (x *Projection) Reset() { *x = Projection{} - mi := &file_sink_sink_proto_msgTypes[25] + mi := &file_sink_sink_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1943,7 +1882,7 @@ func (x *Projection) String() string { func (*Projection) ProtoMessage() {} func (x *Projection) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[25] + mi := &file_sink_sink_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1956,7 +1895,7 @@ func (x *Projection) ProtoReflect() protoreflect.Message { // Deprecated: Use Projection.ProtoReflect.Descriptor instead. func (*Projection) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{25} + return file_sink_sink_proto_rawDescGZIP(), []int{24} } func (x *Projection) GetFields() []string { @@ -1989,7 +1928,7 @@ type QueryResponse struct { func (x *QueryResponse) Reset() { *x = QueryResponse{} - mi := &file_sink_sink_proto_msgTypes[26] + mi := &file_sink_sink_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2001,7 +1940,7 @@ func (x *QueryResponse) String() string { func (*QueryResponse) ProtoMessage() {} func (x *QueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[26] + mi := &file_sink_sink_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2014,7 +1953,7 @@ func (x *QueryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. func (*QueryResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{26} + return file_sink_sink_proto_rawDescGZIP(), []int{25} } func (x *QueryResponse) GetDocuments() []*Document { @@ -2055,7 +1994,7 @@ type CountRequest struct { func (x *CountRequest) Reset() { *x = CountRequest{} - mi := &file_sink_sink_proto_msgTypes[27] + mi := &file_sink_sink_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2067,7 +2006,7 @@ func (x *CountRequest) String() string { func (*CountRequest) ProtoMessage() {} func (x *CountRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[27] + mi := &file_sink_sink_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2080,7 +2019,7 @@ func (x *CountRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CountRequest.ProtoReflect.Descriptor instead. func (*CountRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{27} + return file_sink_sink_proto_rawDescGZIP(), []int{26} } func (x *CountRequest) GetCommand() *Command { @@ -2101,7 +2040,7 @@ type CountResponse struct { func (x *CountResponse) Reset() { *x = CountResponse{} - mi := &file_sink_sink_proto_msgTypes[28] + mi := &file_sink_sink_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2113,7 +2052,7 @@ func (x *CountResponse) String() string { func (*CountResponse) ProtoMessage() {} func (x *CountResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[28] + mi := &file_sink_sink_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2126,7 +2065,7 @@ func (x *CountResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CountResponse.ProtoReflect.Descriptor instead. func (*CountResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{28} + return file_sink_sink_proto_rawDescGZIP(), []int{27} } func (x *CountResponse) GetCount() uint64 { @@ -2167,7 +2106,7 @@ type ScanRequest struct { func (x *ScanRequest) Reset() { *x = ScanRequest{} - mi := &file_sink_sink_proto_msgTypes[29] + mi := &file_sink_sink_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2179,7 +2118,7 @@ func (x *ScanRequest) String() string { func (*ScanRequest) ProtoMessage() {} func (x *ScanRequest) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[29] + mi := &file_sink_sink_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2192,7 +2131,7 @@ func (x *ScanRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ScanRequest.ProtoReflect.Descriptor instead. func (*ScanRequest) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{29} + return file_sink_sink_proto_rawDescGZIP(), []int{28} } func (x *ScanRequest) GetCommand() *Command { @@ -2241,7 +2180,7 @@ type ScanResponse struct { func (x *ScanResponse) Reset() { *x = ScanResponse{} - mi := &file_sink_sink_proto_msgTypes[30] + mi := &file_sink_sink_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2253,7 +2192,7 @@ func (x *ScanResponse) String() string { func (*ScanResponse) ProtoMessage() {} func (x *ScanResponse) ProtoReflect() protoreflect.Message { - mi := &file_sink_sink_proto_msgTypes[30] + mi := &file_sink_sink_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2266,7 +2205,7 @@ func (x *ScanResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ScanResponse.ProtoReflect.Descriptor instead. func (*ScanResponse) Descriptor() ([]byte, []int) { - return file_sink_sink_proto_rawDescGZIP(), []int{30} + return file_sink_sink_proto_rawDescGZIP(), []int{29} } func (x *ScanResponse) GetDocuments() []*Document { @@ -2299,9 +2238,7 @@ const file_sink_sink_proto_rawDesc = "" + "\x03uri\x18\x01 \x01(\tR\x03uri\"[\n" + "\bDocument\x125\n" + "\bencoding\x18\x01 \x01(\x0e2\x19.sink.v1.DocumentEncodingR\bencoding\x12\x18\n" + - "\apayload\x18\x02 \x01(\fR\apayload\"#\n" + - "\rRevisionToken\x12\x12\n" + - "\x04data\x18\x01 \x01(\fR\x04data\"E\n" + + "\apayload\x18\x02 \x01(\fR\apayload\"E\n" + "\vReadRequest\x126\n" + "\n" + "operations\x18\x01 \x03(\v2\x16.sink.v1.ReadOperationR\n" + @@ -2309,13 +2246,12 @@ const file_sink_sink_proto_rawDesc = "" + "\rReadOperation\x120\n" + "\aaddress\x18\x01 \x01(\v2\x16.sink.v1.RecordAddressR\aaddress\"=\n" + "\fReadResponse\x12-\n" + - "\aresults\x18\x01 \x03(\v2\x13.sink.v1.ReadResultR\aresults\"\xf1\x01\n" + + "\aresults\x18\x01 \x03(\v2\x13.sink.v1.ReadResultR\aresults\"\xbd\x01\n" + "\n" + "ReadResult\x12'\n" + "\x0foperation_index\x18\x01 \x01(\rR\x0eoperationIndex\x12+\n" + "\x06status\x18\x02 \x01(\x0e2\x13.sink.v1.ReadStatusR\x06status\x12-\n" + - "\bdocument\x18\x03 \x01(\v2\x11.sink.v1.DocumentR\bdocument\x122\n" + - "\brevision\x18\x04 \x01(\v2\x16.sink.v1.RevisionTokenR\brevision\x12*\n" + + "\bdocument\x18\x03 \x01(\v2\x11.sink.v1.DocumentR\bdocument\x12*\n" + "\afailure\x18\x05 \x01(\v2\x10.sink.v1.FailureR\afailure\"\xc1\x01\n" + "\fWriteRequest\x12@\n" + "\x0fcompletion_mode\x18\x01 \x01(\x0e2\x17.sink.v1.CompletionModeR\x0ecompletionMode\x127\n" + @@ -2341,11 +2277,10 @@ const file_sink_sink_proto_rawDesc = "" + "\x06source\x18\x01 \x01(\fR\x06source\x12\x16\n" + "\x06sha256\x18\x02 \x01(\fR\x06sha256\"?\n" + "\rWriteResponse\x12.\n" + - "\aresults\x18\x01 \x03(\v2\x14.sink.v1.WriteResultR\aresults\"\xf3\x01\n" + + "\aresults\x18\x01 \x03(\v2\x14.sink.v1.WriteResultR\aresults\"\xbf\x01\n" + "\vWriteResult\x12'\n" + "\x0foperation_index\x18\x01 \x01(\rR\x0eoperationIndex\x12,\n" + - "\x06status\x18\x02 \x01(\x0e2\x14.sink.v1.WriteStatusR\x06status\x122\n" + - "\brevision\x18\x03 \x01(\v2\x16.sink.v1.RevisionTokenR\brevision\x12*\n" + + "\x06status\x18\x02 \x01(\x0e2\x14.sink.v1.WriteStatusR\x06status\x12*\n" + "\afailure\x18\x04 \x01(\v2\x10.sink.v1.FailureR\afailure\x12-\n" + "\bdocument\x18\x05 \x01(\v2\x11.sink.v1.DocumentR\bdocument\"\x8b\x01\n" + "\rDeleteRequest\x12@\n" + @@ -2487,7 +2422,7 @@ func file_sink_sink_proto_rawDescGZIP() []byte { } var file_sink_sink_proto_enumTypes = make([]protoimpl.EnumInfo, 7) -var file_sink_sink_proto_msgTypes = make([]protoimpl.MessageInfo, 31) +var file_sink_sink_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_sink_sink_proto_goTypes = []any{ (DocumentEncoding)(0), // 0: sink.v1.DocumentEncoding (CompletionMode)(0), // 1: sink.v1.CompletionMode @@ -2498,97 +2433,94 @@ var file_sink_sink_proto_goTypes = []any{ (FailureCode)(0), // 6: sink.v1.FailureCode (*RecordAddress)(nil), // 7: sink.v1.RecordAddress (*Document)(nil), // 8: sink.v1.Document - (*RevisionToken)(nil), // 9: sink.v1.RevisionToken - (*ReadRequest)(nil), // 10: sink.v1.ReadRequest - (*ReadOperation)(nil), // 11: sink.v1.ReadOperation - (*ReadResponse)(nil), // 12: sink.v1.ReadResponse - (*ReadResult)(nil), // 13: sink.v1.ReadResult - (*WriteRequest)(nil), // 14: sink.v1.WriteRequest - (*WriteOperation)(nil), // 15: sink.v1.WriteOperation - (*PutOperation)(nil), // 16: sink.v1.PutOperation - (*MergeOperation)(nil), // 17: sink.v1.MergeOperation - (*LuaProgram)(nil), // 18: sink.v1.LuaProgram - (*WriteResponse)(nil), // 19: sink.v1.WriteResponse - (*WriteResult)(nil), // 20: sink.v1.WriteResult - (*DeleteRequest)(nil), // 21: sink.v1.DeleteRequest - (*DeleteOperation)(nil), // 22: sink.v1.DeleteOperation - (*DeleteResponse)(nil), // 23: sink.v1.DeleteResponse - (*DeleteResult)(nil), // 24: sink.v1.DeleteResult - (*Failure)(nil), // 25: sink.v1.Failure - (*Command)(nil), // 26: sink.v1.Command - (*Header)(nil), // 27: sink.v1.Header - (*ExecuteRequest)(nil), // 28: sink.v1.ExecuteRequest - (*ExecuteResponse)(nil), // 29: sink.v1.ExecuteResponse - (*QueryRequest)(nil), // 30: sink.v1.QueryRequest - (*SortField)(nil), // 31: sink.v1.SortField - (*Projection)(nil), // 32: sink.v1.Projection - (*QueryResponse)(nil), // 33: sink.v1.QueryResponse - (*CountRequest)(nil), // 34: sink.v1.CountRequest - (*CountResponse)(nil), // 35: sink.v1.CountResponse - (*ScanRequest)(nil), // 36: sink.v1.ScanRequest - (*ScanResponse)(nil), // 37: sink.v1.ScanResponse + (*ReadRequest)(nil), // 9: sink.v1.ReadRequest + (*ReadOperation)(nil), // 10: sink.v1.ReadOperation + (*ReadResponse)(nil), // 11: sink.v1.ReadResponse + (*ReadResult)(nil), // 12: sink.v1.ReadResult + (*WriteRequest)(nil), // 13: sink.v1.WriteRequest + (*WriteOperation)(nil), // 14: sink.v1.WriteOperation + (*PutOperation)(nil), // 15: sink.v1.PutOperation + (*MergeOperation)(nil), // 16: sink.v1.MergeOperation + (*LuaProgram)(nil), // 17: sink.v1.LuaProgram + (*WriteResponse)(nil), // 18: sink.v1.WriteResponse + (*WriteResult)(nil), // 19: sink.v1.WriteResult + (*DeleteRequest)(nil), // 20: sink.v1.DeleteRequest + (*DeleteOperation)(nil), // 21: sink.v1.DeleteOperation + (*DeleteResponse)(nil), // 22: sink.v1.DeleteResponse + (*DeleteResult)(nil), // 23: sink.v1.DeleteResult + (*Failure)(nil), // 24: sink.v1.Failure + (*Command)(nil), // 25: sink.v1.Command + (*Header)(nil), // 26: sink.v1.Header + (*ExecuteRequest)(nil), // 27: sink.v1.ExecuteRequest + (*ExecuteResponse)(nil), // 28: sink.v1.ExecuteResponse + (*QueryRequest)(nil), // 29: sink.v1.QueryRequest + (*SortField)(nil), // 30: sink.v1.SortField + (*Projection)(nil), // 31: sink.v1.Projection + (*QueryResponse)(nil), // 32: sink.v1.QueryResponse + (*CountRequest)(nil), // 33: sink.v1.CountRequest + (*CountResponse)(nil), // 34: sink.v1.CountResponse + (*ScanRequest)(nil), // 35: sink.v1.ScanRequest + (*ScanResponse)(nil), // 36: sink.v1.ScanResponse } var file_sink_sink_proto_depIdxs = []int32{ 0, // 0: sink.v1.Document.encoding:type_name -> sink.v1.DocumentEncoding - 11, // 1: sink.v1.ReadRequest.operations:type_name -> sink.v1.ReadOperation + 10, // 1: sink.v1.ReadRequest.operations:type_name -> sink.v1.ReadOperation 7, // 2: sink.v1.ReadOperation.address:type_name -> sink.v1.RecordAddress - 13, // 3: sink.v1.ReadResponse.results:type_name -> sink.v1.ReadResult + 12, // 3: sink.v1.ReadResponse.results:type_name -> sink.v1.ReadResult 2, // 4: sink.v1.ReadResult.status:type_name -> sink.v1.ReadStatus 8, // 5: sink.v1.ReadResult.document:type_name -> sink.v1.Document - 9, // 6: sink.v1.ReadResult.revision:type_name -> sink.v1.RevisionToken - 25, // 7: sink.v1.ReadResult.failure:type_name -> sink.v1.Failure - 1, // 8: sink.v1.WriteRequest.completion_mode:type_name -> sink.v1.CompletionMode - 15, // 9: sink.v1.WriteRequest.operations:type_name -> sink.v1.WriteOperation - 18, // 10: sink.v1.WriteRequest.lua_programs:type_name -> sink.v1.LuaProgram - 7, // 11: sink.v1.WriteOperation.address:type_name -> sink.v1.RecordAddress - 16, // 12: sink.v1.WriteOperation.put:type_name -> sink.v1.PutOperation - 17, // 13: sink.v1.WriteOperation.merge:type_name -> sink.v1.MergeOperation - 8, // 14: sink.v1.PutOperation.document:type_name -> sink.v1.Document - 3, // 15: sink.v1.PutOperation.mode:type_name -> sink.v1.WriteMode - 8, // 16: sink.v1.MergeOperation.incoming_document:type_name -> sink.v1.Document - 18, // 17: sink.v1.MergeOperation.lua_program:type_name -> sink.v1.LuaProgram - 20, // 18: sink.v1.WriteResponse.results:type_name -> sink.v1.WriteResult - 4, // 19: sink.v1.WriteResult.status:type_name -> sink.v1.WriteStatus - 9, // 20: sink.v1.WriteResult.revision:type_name -> sink.v1.RevisionToken - 25, // 21: sink.v1.WriteResult.failure:type_name -> sink.v1.Failure - 8, // 22: sink.v1.WriteResult.document:type_name -> sink.v1.Document - 1, // 23: sink.v1.DeleteRequest.completion_mode:type_name -> sink.v1.CompletionMode - 22, // 24: sink.v1.DeleteRequest.operations:type_name -> sink.v1.DeleteOperation - 7, // 25: sink.v1.DeleteOperation.address:type_name -> sink.v1.RecordAddress - 24, // 26: sink.v1.DeleteResponse.results:type_name -> sink.v1.DeleteResult - 5, // 27: sink.v1.DeleteResult.status:type_name -> sink.v1.DeleteStatus - 25, // 28: sink.v1.DeleteResult.failure:type_name -> sink.v1.Failure - 6, // 29: sink.v1.Failure.code:type_name -> sink.v1.FailureCode - 27, // 30: sink.v1.Command.headers:type_name -> sink.v1.Header - 26, // 31: sink.v1.ExecuteRequest.command:type_name -> sink.v1.Command - 27, // 32: sink.v1.ExecuteResponse.headers:type_name -> sink.v1.Header - 26, // 33: sink.v1.QueryRequest.command:type_name -> sink.v1.Command - 31, // 34: sink.v1.QueryRequest.sort:type_name -> sink.v1.SortField - 32, // 35: sink.v1.QueryRequest.projection:type_name -> sink.v1.Projection - 8, // 36: sink.v1.QueryResponse.documents:type_name -> sink.v1.Document - 26, // 37: sink.v1.CountRequest.command:type_name -> sink.v1.Command - 26, // 38: sink.v1.ScanRequest.command:type_name -> sink.v1.Command - 32, // 39: sink.v1.ScanRequest.projection:type_name -> sink.v1.Projection - 8, // 40: sink.v1.ScanResponse.documents:type_name -> sink.v1.Document - 10, // 41: sink.v1.Sink.Read:input_type -> sink.v1.ReadRequest - 14, // 42: sink.v1.Sink.Write:input_type -> sink.v1.WriteRequest - 21, // 43: sink.v1.Sink.Delete:input_type -> sink.v1.DeleteRequest - 28, // 44: sink.v1.Sink.Execute:input_type -> sink.v1.ExecuteRequest - 30, // 45: sink.v1.Sink.Query:input_type -> sink.v1.QueryRequest - 34, // 46: sink.v1.Sink.Count:input_type -> sink.v1.CountRequest - 36, // 47: sink.v1.Sink.Scan:input_type -> sink.v1.ScanRequest - 12, // 48: sink.v1.Sink.Read:output_type -> sink.v1.ReadResponse - 19, // 49: sink.v1.Sink.Write:output_type -> sink.v1.WriteResponse - 23, // 50: sink.v1.Sink.Delete:output_type -> sink.v1.DeleteResponse - 29, // 51: sink.v1.Sink.Execute:output_type -> sink.v1.ExecuteResponse - 33, // 52: sink.v1.Sink.Query:output_type -> sink.v1.QueryResponse - 35, // 53: sink.v1.Sink.Count:output_type -> sink.v1.CountResponse - 37, // 54: sink.v1.Sink.Scan:output_type -> sink.v1.ScanResponse - 48, // [48:55] is the sub-list for method output_type - 41, // [41:48] is the sub-list for method input_type - 41, // [41:41] is the sub-list for extension type_name - 41, // [41:41] is the sub-list for extension extendee - 0, // [0:41] is the sub-list for field type_name + 24, // 6: sink.v1.ReadResult.failure:type_name -> sink.v1.Failure + 1, // 7: sink.v1.WriteRequest.completion_mode:type_name -> sink.v1.CompletionMode + 14, // 8: sink.v1.WriteRequest.operations:type_name -> sink.v1.WriteOperation + 17, // 9: sink.v1.WriteRequest.lua_programs:type_name -> sink.v1.LuaProgram + 7, // 10: sink.v1.WriteOperation.address:type_name -> sink.v1.RecordAddress + 15, // 11: sink.v1.WriteOperation.put:type_name -> sink.v1.PutOperation + 16, // 12: sink.v1.WriteOperation.merge:type_name -> sink.v1.MergeOperation + 8, // 13: sink.v1.PutOperation.document:type_name -> sink.v1.Document + 3, // 14: sink.v1.PutOperation.mode:type_name -> sink.v1.WriteMode + 8, // 15: sink.v1.MergeOperation.incoming_document:type_name -> sink.v1.Document + 17, // 16: sink.v1.MergeOperation.lua_program:type_name -> sink.v1.LuaProgram + 19, // 17: sink.v1.WriteResponse.results:type_name -> sink.v1.WriteResult + 4, // 18: sink.v1.WriteResult.status:type_name -> sink.v1.WriteStatus + 24, // 19: sink.v1.WriteResult.failure:type_name -> sink.v1.Failure + 8, // 20: sink.v1.WriteResult.document:type_name -> sink.v1.Document + 1, // 21: sink.v1.DeleteRequest.completion_mode:type_name -> sink.v1.CompletionMode + 21, // 22: sink.v1.DeleteRequest.operations:type_name -> sink.v1.DeleteOperation + 7, // 23: sink.v1.DeleteOperation.address:type_name -> sink.v1.RecordAddress + 23, // 24: sink.v1.DeleteResponse.results:type_name -> sink.v1.DeleteResult + 5, // 25: sink.v1.DeleteResult.status:type_name -> sink.v1.DeleteStatus + 24, // 26: sink.v1.DeleteResult.failure:type_name -> sink.v1.Failure + 6, // 27: sink.v1.Failure.code:type_name -> sink.v1.FailureCode + 26, // 28: sink.v1.Command.headers:type_name -> sink.v1.Header + 25, // 29: sink.v1.ExecuteRequest.command:type_name -> sink.v1.Command + 26, // 30: sink.v1.ExecuteResponse.headers:type_name -> sink.v1.Header + 25, // 31: sink.v1.QueryRequest.command:type_name -> sink.v1.Command + 30, // 32: sink.v1.QueryRequest.sort:type_name -> sink.v1.SortField + 31, // 33: sink.v1.QueryRequest.projection:type_name -> sink.v1.Projection + 8, // 34: sink.v1.QueryResponse.documents:type_name -> sink.v1.Document + 25, // 35: sink.v1.CountRequest.command:type_name -> sink.v1.Command + 25, // 36: sink.v1.ScanRequest.command:type_name -> sink.v1.Command + 31, // 37: sink.v1.ScanRequest.projection:type_name -> sink.v1.Projection + 8, // 38: sink.v1.ScanResponse.documents:type_name -> sink.v1.Document + 9, // 39: sink.v1.Sink.Read:input_type -> sink.v1.ReadRequest + 13, // 40: sink.v1.Sink.Write:input_type -> sink.v1.WriteRequest + 20, // 41: sink.v1.Sink.Delete:input_type -> sink.v1.DeleteRequest + 27, // 42: sink.v1.Sink.Execute:input_type -> sink.v1.ExecuteRequest + 29, // 43: sink.v1.Sink.Query:input_type -> sink.v1.QueryRequest + 33, // 44: sink.v1.Sink.Count:input_type -> sink.v1.CountRequest + 35, // 45: sink.v1.Sink.Scan:input_type -> sink.v1.ScanRequest + 11, // 46: sink.v1.Sink.Read:output_type -> sink.v1.ReadResponse + 18, // 47: sink.v1.Sink.Write:output_type -> sink.v1.WriteResponse + 22, // 48: sink.v1.Sink.Delete:output_type -> sink.v1.DeleteResponse + 28, // 49: sink.v1.Sink.Execute:output_type -> sink.v1.ExecuteResponse + 32, // 50: sink.v1.Sink.Query:output_type -> sink.v1.QueryResponse + 34, // 51: sink.v1.Sink.Count:output_type -> sink.v1.CountResponse + 36, // 52: sink.v1.Sink.Scan:output_type -> sink.v1.ScanResponse + 46, // [46:53] is the sub-list for method output_type + 39, // [39:46] is the sub-list for method input_type + 39, // [39:39] is the sub-list for extension type_name + 39, // [39:39] is the sub-list for extension extendee + 0, // [0:39] is the sub-list for field type_name } func init() { file_sink_sink_proto_init() } @@ -2596,7 +2528,7 @@ func file_sink_sink_proto_init() { if File_sink_sink_proto != nil { return } - file_sink_sink_proto_msgTypes[8].OneofWrappers = []any{ + file_sink_sink_proto_msgTypes[7].OneofWrappers = []any{ (*WriteOperation_Put)(nil), (*WriteOperation_Merge)(nil), } @@ -2606,7 +2538,7 @@ func file_sink_sink_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_sink_sink_proto_rawDesc), len(file_sink_sink_proto_rawDesc)), NumEnums: 7, - NumMessages: 31, + NumMessages: 30, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/sink/sink_vtproto.pb.go b/gen/sink/sink_vtproto.pb.go index fd3d0cb..cb30218 100644 --- a/gen/sink/sink_vtproto.pb.go +++ b/gen/sink/sink_vtproto.pb.go @@ -103,46 +103,6 @@ func (m *Document) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RevisionToken) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RevisionToken) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *RevisionToken) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ReadRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -316,16 +276,6 @@ func (m *ReadResult) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if m.Revision != nil { - size, err := m.Revision.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } if m.Document != nil { size, err := m.Document.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -754,16 +704,6 @@ func (m *WriteResult) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if m.Revision != nil { - size, err := m.Revision.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } if m.Status != 0 { i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) i-- @@ -1767,20 +1707,6 @@ func (m *Document) SizeVT() (n int) { return n } -func (m *RevisionToken) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } - n += len(m.unknownFields) - return n -} - func (m *ReadRequest) SizeVT() (n int) { if m == nil { return 0 @@ -1843,10 +1769,6 @@ func (m *ReadResult) SizeVT() (n int) { l = m.Document.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } - if m.Revision != nil { - l = m.Revision.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } if m.Failure != nil { l = m.Failure.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -2005,10 +1927,6 @@ func (m *WriteResult) SizeVT() (n int) { if m.Status != 0 { n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) } - if m.Revision != nil { - l = m.Revision.SizeVT() - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) - } if m.Failure != nil { l = m.Failure.SizeVT() n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) @@ -2567,91 +2485,6 @@ func (m *Document) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *RevisionToken) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RevisionToken: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RevisionToken: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := protohelpers.Skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protohelpers.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ReadRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3012,42 +2845,6 @@ func (m *ReadResult) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Revision == nil { - m.Revision = &RevisionToken{} - } - if err := m.Revision.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) @@ -3933,42 +3730,6 @@ func (m *WriteResult) UnmarshalVT(dAtA []byte) error { break } } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protohelpers.ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protohelpers.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protohelpers.ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Revision == nil { - m.Revision = &RevisionToken{} - } - if err := m.Revision.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) diff --git a/internal/app/storage.go b/internal/app/storage.go index 68123c1..1c46461 100644 --- a/internal/app/storage.go +++ b/internal/app/storage.go @@ -64,10 +64,8 @@ func openMongoStorage(ctx context.Context, configured config.Storage, shutdownTi } storageOptions := mongodb.Options{ - Store: configured.Name, - MetadataField: configured.MongoDB.MetadataField, - MaxConcurrentWrites: configured.MongoDB.MaxConcurrentWrites, - MaxConcurrentGroups: configured.MongoDB.MaxConcurrentGroups, + Store: configured.Name, + MetadataField: configured.MongoDB.MetadataField, } store, err := mongodb.New(mongoClient, storageOptions) if err != nil { diff --git a/internal/config/config.go b/internal/config/config.go index 1945bb8..83f248b 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -101,10 +101,8 @@ type Storage struct { } type MongoDB struct { - URI string - MetadataField string - MaxConcurrentWrites int - MaxConcurrentGroups int + URI string + MetadataField string } type Search struct { diff --git a/internal/config/config_test.go b/internal/config/config_test.go index a624686..33614ec 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -24,7 +24,7 @@ func writeConfig(t *testing.T, contents string) string { } func TestSharedStoreWithIndependentRoleSettings(t *testing.T) { - storePath := writeConfig(t, strings.Replace(kafkaStore, " mongodb:\n", " mongodb:\n max_concurrent_writes: 17\n max_concurrent_groups: 5\n", 1)) + storePath := writeConfig(t, kafkaStore) enginePath := writeConfig(t, "mode: engine\nproducer: {max_buffered_bytes: 8MiB}\n") workerPath := writeConfig(t, "mode: worker\nconsumer: {group_id: workers, max_poll_records: 2000}\n") engine, err := Load(enginePath, storePath) @@ -38,7 +38,7 @@ func TestSharedStoreWithIndependentRoleSettings(t *testing.T) { if engine.Storage.Name != worker.Storage.Name || engine.Storage.MongoDB.URI != worker.Storage.MongoDB.URI || !reflect.DeepEqual(engine.Storage.Kafka.Topic, worker.Storage.Kafka.Topic) { t.Fatal("shared identity or dependencies diverged") } - if engine.Storage.MongoDB.MaxConcurrentWrites != 17 || worker.Storage.MongoDB.MaxConcurrentWrites != 17 || engine.Storage.MongoDB.MaxConcurrentGroups != 5 || worker.Storage.MongoDB.MaxConcurrentGroups != 5 || worker.Storage.Kafka.Consumer.MaxPollRecords != 2000 || engine.Storage.Kafka.Producer.MaxBufferedBytes != 8<<20 { + if worker.Storage.Kafka.Consumer.MaxPollRecords != 2000 || engine.Storage.Kafka.Producer.MaxBufferedBytes != 8<<20 { t.Fatal("role tuning was not independent") } if worker.Storage.Kafka.Consumer.GroupID != "workers" || engine.Storage.Kafka.Consumer.GroupID != "" { @@ -57,7 +57,7 @@ func TestComponentDefaults(t *testing.T) { if engine.Service.Batching.MaxOperations != 32 || engine.Service.Batching.MaxWait != 2*time.Millisecond || engine.Service.Batching.Queue.MaxBytes != 128<<20 { t.Fatal("batch defaults changed") } - if engine.Storage.MongoDB.MaxConcurrentWrites != 64 || engine.Storage.MongoDB.MaxConcurrentGroups != 16 || engine.Service.Merge.Lua.MaxResultBytes != 16<<20 { + if engine.Service.Merge.Lua.MaxResultBytes != 16<<20 { t.Fatal("execution defaults changed") } if engine.Storage.Kafka.Enabled || engine.Prometheus.Enabled || engine.Health.Address != ":8081" || engine.GRPC.MaxSendMessageBytes != 64<<20 { diff --git a/internal/config/file.go b/internal/config/file.go index 6fa8021..04ccaec 100644 --- a/internal/config/file.go +++ b/internal/config/file.go @@ -83,11 +83,9 @@ type storageFile struct { } type mongoDBFile struct { - URI *string `yaml:"uri"` - URIFile *string `yaml:"uri_file"` - MetadataField string `yaml:"metadata_field"` - MaxConcurrentWrites *int `yaml:"max_concurrent_writes"` - MaxConcurrentGroups *int `yaml:"max_concurrent_groups"` + URI *string `yaml:"uri"` + URIFile *string `yaml:"uri_file"` + MetadataField string `yaml:"metadata_field"` } type searchFile struct { diff --git a/internal/config/limits_test.go b/internal/config/limits_test.go index 028c067..02e68c5 100644 --- a/internal/config/limits_test.go +++ b/internal/config/limits_test.go @@ -18,17 +18,17 @@ func TestExecutionRejectsRemovedLimits(t *testing.T) { } } -func TestMongoDBStoreConcurrencyValidation(t *testing.T) { +func TestMongoDBStoreRejectsRemovedConcurrencyLimits(t *testing.T) { for _, field := range []string{"max_concurrent_writes", "max_concurrent_groups"} { - for _, value := range []string{"0", "-1"} { + for _, value := range []string{"0", "-1", "16", "64"} { shared := minimalStorage + " " + field + ": " + value + "\n" _, err := Decode(strings.NewReader("mode: engine"), strings.NewReader(shared)) - if err == nil || !strings.Contains(err.Error(), "storage.mongodb."+field) { - t.Fatalf("invalid concurrency accepted: %s: %v", shared, err) + if err == nil || !strings.Contains(err.Error(), "field "+field+" not found") { + t.Fatalf("removed concurrency setting accepted: %s: %v", shared, err) } } } - shared := "name: primary\nstorage:\n driver: opensearch\n search: {endpoints: [http://localhost:9200]}\n mongodb: {max_concurrent_writes: 4}\n" + shared := "name: primary\nstorage:\n driver: opensearch\n search: {endpoints: [http://localhost:9200]}\n mongodb: {metadata_field: custom}\n" _, err := Decode(strings.NewReader("mode: engine"), strings.NewReader(shared)) if err == nil || !strings.Contains(err.Error(), "requires the mongodb driver") { t.Fatalf("MongoDB tuning accepted by another driver: %v", err) diff --git a/internal/config/storage.go b/internal/config/storage.go index 42a4038..93b3a7e 100644 --- a/internal/config/storage.go +++ b/internal/config/storage.go @@ -7,7 +7,6 @@ import ( func resolveStorage(prefix string, file storageFile) (Storage, error) { var loaded Storage - v := validator{} loaded.Driver = Driver(strings.TrimSpace(string(file.Driver))) if loaded.Driver != DriverMongoDB && file.MongoDB != (mongoDBFile{}) { return loaded, fmt.Errorf("%s.mongodb requires the mongodb driver", prefix) @@ -24,8 +23,6 @@ func resolveStorage(prefix string, file storageFile) (Storage, error) { return loaded, fmt.Errorf("%s.mongodb.uri is required when driver is mongodb", prefix) } mongo.MetadataField = valueOrDefault(file.MongoDB.MetadataField, "__sink") - mongo.MaxConcurrentWrites = v.integer(prefix+".mongodb.max_concurrent_writes", file.MongoDB.MaxConcurrentWrites, 64) - mongo.MaxConcurrentGroups = v.integer(prefix+".mongodb.max_concurrent_groups", file.MongoDB.MaxConcurrentGroups, 16) case DriverElasticsearch, DriverOpenSearch: search := &loaded.Search search.Endpoints = nonEmptyValues(file.Search.Endpoints) @@ -54,5 +51,5 @@ func resolveStorage(prefix string, file storageFile) (Storage, error) { default: return loaded, fmt.Errorf("%s.driver must be mongodb, elasticsearch, or opensearch", prefix) } - return loaded, v.err + return loaded, nil } diff --git a/internal/service/convert.go b/internal/service/convert.go index 776b944..9befcc9 100644 --- a/internal/service/convert.go +++ b/internal/service/convert.go @@ -53,7 +53,6 @@ func applyReadResult(result *sink.ReadResult, stored storage.ReadResult) { Payload: bytes.Clone(stored.Document.Payload), } result.Document = document - result.Revision = &sink.RevisionToken{Data: bytes.Clone(stored.Revision.Data)} case storage.ReadStatusNotFound: result.Status = sink.ReadStatus_READ_STATUS_NOT_FOUND case storage.ReadStatusFailed: @@ -69,7 +68,6 @@ func applyWriteResult(result *sink.WriteResult, stored storage.WriteResult) { switch stored.Status { case storage.WriteStatusApplied: result.Status = sink.WriteStatus_WRITE_STATUS_APPLIED - result.Revision = &sink.RevisionToken{Data: bytes.Clone(stored.Revision.Data)} case storage.WriteStatusPreconditionFailed: result.Status = sink.WriteStatus_WRITE_STATUS_PRECONDITION_FAILED failure := &sink.Failure{ diff --git a/internal/service/merge_group_test.go b/internal/service/merge_group_test.go index c7a1e6d..33223c3 100644 --- a/internal/service/merge_group_test.go +++ b/internal/service/merge_group_test.go @@ -1,7 +1,6 @@ package service_test import ( - "bytes" "context" "encoding/json" "errors" @@ -55,7 +54,6 @@ func TestMergeFoldingAcrossRPCsPreservesResponseBoundaries(t *testing.T) { errs <- err }() } - var revision []byte for range callers { if err := <-errs; err != nil { t.Fatal(err) @@ -69,11 +67,6 @@ func TestMergeFoldingAcrossRPCsPreservesResponseBoundaries(t *testing.T) { t.Fatalf("result boundary: %v", result) } } - if revision == nil { - revision = response.Results[0].GetRevision().GetData() - } else if !bytes.Equal(revision, response.Results[0].GetRevision().GetData()) { - t.Fatal("hot writes were not folded across RPCs") - } } if observed.readCalls.Load() != 1 || observed.writeCalls.Load() != 1 || observed.maxWriteOperations.Load() != callers+1 || !observed.writeWaitVisible.Load() { t.Fatalf("batch reads=%d writes=%d docs=%d visible=%t", observed.readCalls.Load(), observed.writeCalls.Load(), observed.maxWriteOperations.Load(), observed.writeWaitVisible.Load()) @@ -195,7 +188,7 @@ func foldingValue(t testing.TB, backend storage.Storage, key string) int { return document.Value } -func TestMergeFoldingPreservesOrderAndSharesCommitRevision(t *testing.T) { +func TestMergeFoldingPreservesOrderAndCommitsOnce(t *testing.T) { backend := memory.New() observed := &countingStorage{backend: backend} server := newTestServer(t, observed, nil) @@ -223,9 +216,6 @@ func TestMergeFoldingPreservesOrderAndSharesCommitRevision(t *testing.T) { if result.OperationIndex != uint32(index) || result.Status != sink.WriteStatus_WRITE_STATUS_APPLIED || result.Failure != nil { t.Fatalf("result %d: %v", index, result) } - if len(result.GetRevision().GetData()) == 0 || !bytes.Equal(result.GetRevision().GetData(), response.Results[0].GetRevision().GetData()) { - t.Fatalf("result %d did not share the final commit revision", index) - } } if got := foldingValue(t, backend, "ordered"); got != 123 { t.Fatalf("ordered value = %d", got) @@ -257,9 +247,6 @@ func TestWriteFoldingPreservesPutBetweenMerges(t *testing.T) { if observed.readCalls.Load() != 1 || observed.writeCalls.Load() != 1 { t.Fatalf("folded reads=%d writes=%d", observed.readCalls.Load(), observed.writeCalls.Load()) } - if !bytes.Equal(response.Results[0].GetRevision().GetData(), response.Results[3].GetRevision().GetData()) { - t.Fatal("writes to one record did not share the final commit") - } } func TestMergeFoldingCreatesMissingRecordAndRetainsLuaFailures(t *testing.T) { @@ -363,7 +350,7 @@ func TestMergeFoldingDoesNotAcknowledgeOrReplayFailedCommit(t *testing.T) { t.Fatal(err) } for _, result := range response.Results { - if result.Status != sink.WriteStatus_WRITE_STATUS_FAILED || result.GetFailure().GetCode() != sink.FailureCode_FAILURE_CODE_UNAVAILABLE || len(result.GetRevision().GetData()) != 0 { + if result.Status != sink.WriteStatus_WRITE_STATUS_FAILED || result.GetFailure().GetCode() != sink.FailureCode_FAILURE_CODE_UNAVAILABLE { t.Fatalf("acknowledged an uncommitted outcome: %v", result) } } diff --git a/internal/service/operation_folding_test.go b/internal/service/operation_folding_test.go index 07023fa..2a26d2e 100644 --- a/internal/service/operation_folding_test.go +++ b/internal/service/operation_folding_test.go @@ -62,20 +62,11 @@ func TestPutFoldingMatchesSequentialPreconditions(t *testing.T) { if err != nil { t.Fatal(err) } - var revision []byte for index, result := range response.Results { want := expected[index] if result.OperationIndex != uint32(index) || result.Status != want.Status || result.GetFailure().GetCode() != want.GetFailure().GetCode() { t.Fatalf("exists=%t sequence=%d operation=%d: got %v want %v", exists, sequence, index, result, want) } - if result.Status == sink.WriteStatus_WRITE_STATUS_APPLIED { - if revision == nil { - revision = result.GetRevision().GetData() - } - if len(revision) == 0 || !bytes.Equal(revision, result.GetRevision().GetData()) { - t.Fatal("puts did not share a committed revision") - } - } } read := storage.ReadOperation{Address: storageAddress("key")} readRequest := storage.ReadRequest{Operations: []storage.ReadOperation{read}} @@ -91,7 +82,7 @@ func TestPutFoldingMatchesSequentialPreconditions(t *testing.T) { } } -func TestUpsertFoldingAvoidsReadsAndSharesRevision(t *testing.T) { +func TestUpsertFoldingAvoidsReadsAndCommitsOnce(t *testing.T) { observed := &countingStorage{backend: memory.New()} server := newTestServer(t, observed, nil) var operations []*sink.WriteOperation @@ -104,7 +95,7 @@ func TestUpsertFoldingAvoidsReadsAndSharesRevision(t *testing.T) { t.Fatal(err) } for _, result := range response.Results { - if result.Status != sink.WriteStatus_WRITE_STATUS_APPLIED || !bytes.Equal(result.GetRevision().GetData(), response.Results[0].GetRevision().GetData()) { + if result.Status != sink.WriteStatus_WRITE_STATUS_APPLIED { t.Fatal(result) } } diff --git a/internal/service/write_group.go b/internal/service/write_group.go index 477e56b..7c0c4de 100644 --- a/internal/service/write_group.go +++ b/internal/service/write_group.go @@ -23,7 +23,6 @@ func (s *Server) prepareWriteGroup(ctx context.Context, input writeGroupPreparat // failures whose outcome depended on an uncommitted predecessor. result := input.results[operation.index] result.Status = sink.WriteStatus_WRITE_STATUS_UNSPECIFIED - result.Revision = nil result.Failure = nil result.Document = nil var merged storage.WriteOperation diff --git a/internal/service/write_return_test.go b/internal/service/write_return_test.go index e0c3691..fab90a3 100644 --- a/internal/service/write_return_test.go +++ b/internal/service/write_return_test.go @@ -1,7 +1,6 @@ package service_test import ( - "bytes" "encoding/json" "sort" "strings" @@ -38,7 +37,8 @@ func returnedCounter(t *testing.T, result *sink.WriteResult) int { func TestWriteReturningSeparatesSameRecordCommits(t *testing.T) { store := memory.New() - server := newTestServer(t, store, nil) + observed := &countingStorage{backend: store} + server := newTestServer(t, observed, nil) first := returningIncrement("quota") second := returningIncrement("quota") first.Operations = append(first.Operations, second.Operations[0]) @@ -49,7 +49,7 @@ func TestWriteReturningSeparatesSameRecordCommits(t *testing.T) { if returnedCounter(t, response.Results[0]) != 1 || returnedCounter(t, response.Results[1]) != 2 { t.Fatalf("return values=%v", response) } - if bytes.Equal(response.Results[0].GetRevision().GetData(), response.Results[1].GetRevision().GetData()) { + if observed.writeCalls.Load() != 2 { t.Fatal("returning operations shared a commit") } read, err := server.Read(t.Context(), readRequest("quota")) diff --git a/internal/storage/mongodb/capability_test.go b/internal/storage/mongodb/capability_test.go index 7121f73..075d407 100644 --- a/internal/storage/mongodb/capability_test.go +++ b/internal/storage/mongodb/capability_test.go @@ -2,6 +2,7 @@ package mongodb import ( "context" + "sync" "sync/atomic" "testing" "time" @@ -22,6 +23,9 @@ func TestClientBulkDiscoveryCannotUndoCommandRejection(t *testing.T) { deployment := drivertest.NewMockDeployment(hello, hello, rejected, unmatched, unmatched) started := make(chan struct{}) release := make(chan struct{}) + // The wire fixture has one unsynchronized response queue. Serialize only + // fallback updates while keeping the stale discovery response suspended. + var updateMu sync.Mutex var hellos, bulks, updates atomic.Int32 monitor := &event.CommandMonitor{ Started: func(_ context.Context, command *event.CommandStartedEvent) { @@ -29,10 +33,19 @@ func TestClientBulkDiscoveryCannotUndoCommandRejection(t *testing.T) { case "bulkWrite": bulks.Add(1) case "update": + updateMu.Lock() updates.Add(1) } }, + Failed: func(_ context.Context, command *event.CommandFailedEvent) { + if command.CommandName == "update" { + updateMu.Unlock() + } + }, Succeeded: func(ctx context.Context, command *event.CommandSucceededEvent) { + if command.CommandName == "update" { + updateMu.Unlock() + } if command.CommandName == "hello" && hellos.Add(1) == 1 { close(started) select { @@ -51,7 +64,7 @@ func TestClientBulkDiscoveryCannotUndoCommandRejection(t *testing.T) { t.Fatal(err) } t.Cleanup(func() { _ = client.Disconnect(context.Background()) }) - storeOptions := Options{Store: "primary", MaxConcurrentWrites: 1, MaxConcurrentGroups: 1} + storeOptions := Options{Store: "primary"} store, err := New(client, storeOptions) if err != nil { t.Fatal(err) diff --git a/internal/storage/mongodb/conditional_bulk.go b/internal/storage/mongodb/conditional_bulk.go index 716472a..741935b 100644 --- a/internal/storage/mongodb/conditional_bulk.go +++ b/internal/storage/mongodb/conditional_bulk.go @@ -68,18 +68,7 @@ func (s *Store) writeConditionalBulk(ctx context.Context, operations []writeWork if len(writes) == 0 { return } - select { - case s.groups <- struct{}{}: - defer func() { <-s.groups }() - case <-ctx.Done(): - for _, operation := range prepared { - setWriteError(&results[operation.index], storage.BackendError(ctx.Err())) - } - return - } - select { - case s.writes <- struct{}{}: - case <-ctx.Done(): + if ctx.Err() != nil { for _, operation := range prepared { setWriteError(&results[operation.index], storage.BackendError(ctx.Err())) } @@ -87,7 +76,6 @@ func (s *Store) writeConditionalBulk(ctx context.Context, operations []writeWork } bulkOptions := options.ClientBulkWrite().SetOrdered(false).SetVerboseResults(true) response, err := s.client.BulkWrite(ctx, writes, bulkOptions) - <-s.writes if unsupportedClientBulk(response, err) { // Command availability can differ from cached wire-version discovery, // for example after a primary changes. Retry only a command rejection diff --git a/internal/storage/mongodb/delete.go b/internal/storage/mongodb/delete.go index 6336352..99e42b6 100644 --- a/internal/storage/mongodb/delete.go +++ b/internal/storage/mongodb/delete.go @@ -51,9 +51,7 @@ func (s *Store) Delete(ctx context.Context, req storage.DeleteRequest) (storage. var deletes sync.WaitGroup deletes.Add(len(groups)) for _, group := range groups { - select { - case s.groups <- struct{}{}: - case <-ctx.Done(): + if ctx.Err() != nil { for _, operation := range group.operations { setDeleteError(&response.Results[operation.index], storage.BackendError(ctx.Err())) } @@ -62,9 +60,6 @@ func (s *Store) Delete(ctx context.Context, req storage.DeleteRequest) (storage. } go func() { defer deletes.Done() - defer func() { - <-s.groups - }() s.deleteGroup(ctx, group, response.Results) }() } diff --git a/internal/storage/mongodb/read.go b/internal/storage/mongodb/read.go index 12def68..b92bc43 100644 --- a/internal/storage/mongodb/read.go +++ b/internal/storage/mongodb/read.go @@ -70,18 +70,13 @@ func (s *Store) Read(ctx context.Context, req storage.ReadRequest) (storage.Read var reads sync.WaitGroup reads.Add(len(groups)) for _, group := range groups { - select { - case s.groups <- struct{}{}: - case <-ctx.Done(): + if ctx.Err() != nil { s.setReadGroupError(group, response.Results, storage.BackendError(ctx.Err())) reads.Done() continue } go func() { defer reads.Done() - defer func() { - <-s.groups - }() s.readGroup(ctx, group, response.Results) }() } diff --git a/internal/storage/mongodb/store.go b/internal/storage/mongodb/store.go index ca86e13..d1ed8e2 100644 --- a/internal/storage/mongodb/store.go +++ b/internal/storage/mongodb/store.go @@ -15,26 +15,18 @@ import ( ) const ( - defaultMetadataField = "__sink" - defaultConcurrentWrites = 64 - defaultConcurrentGroups = 16 + defaultMetadataField = "__sink" ) type Options struct { - Store string - MetadataField string - MaxConcurrentWrites int - MaxConcurrentGroups int + Store string + MetadataField string } type Store struct { client *mongo.Client store string metadataField string - maxConcurrentWrites int - maxConcurrentGroups int - groups chan struct{} - writes chan struct{} clientBulkCapability atomic.Uint32 } @@ -45,9 +37,6 @@ func New(client *mongo.Client, opts Options) (*Store, error) { if opts.Store == "" { return nil, errors.New("create MongoDB storage: logical store is required") } - if opts.MaxConcurrentWrites < 0 || opts.MaxConcurrentGroups < 0 { - return nil, errors.New("create MongoDB storage: concurrency limits cannot be negative") - } metadataField := opts.MetadataField if metadataField == "" { @@ -57,22 +46,10 @@ func New(client *mongo.Client, opts Options) (*Store, error) { return nil, errors.New("create MongoDB storage: metadata field is invalid") } - maxConcurrentWrites := opts.MaxConcurrentWrites - if maxConcurrentWrites == 0 { - maxConcurrentWrites = defaultConcurrentWrites - } - maxConcurrentGroups := opts.MaxConcurrentGroups - if maxConcurrentGroups == 0 { - maxConcurrentGroups = defaultConcurrentGroups - } store := &Store{ - client: client, - store: opts.Store, - metadataField: metadataField, - maxConcurrentWrites: maxConcurrentWrites, - maxConcurrentGroups: maxConcurrentGroups, - groups: make(chan struct{}, maxConcurrentGroups), - writes: make(chan struct{}, maxConcurrentWrites), + client: client, + store: opts.Store, + metadataField: metadataField, } return store, nil } diff --git a/internal/storage/mongodb/write.go b/internal/storage/mongodb/write.go index a14f19a..38b50d1 100644 --- a/internal/storage/mongodb/write.go +++ b/internal/storage/mongodb/write.go @@ -132,9 +132,7 @@ func (s *Store) writeWave(ctx context.Context, wave []writeWork, results []stora var bulkWrites sync.WaitGroup bulkWrites.Add(len(bulkGroups)) for _, group := range bulkGroups { - select { - case s.groups <- struct{}{}: - case <-ctx.Done(): + if ctx.Err() != nil { for _, operation := range group.operations { setWriteError(&results[operation.index], storage.BackendError(ctx.Err())) } @@ -143,9 +141,6 @@ func (s *Store) writeWave(ctx context.Context, wave []writeWork, results []stora } go func() { defer bulkWrites.Done() - defer func() { - <-s.groups - }() s.bulkWrite(ctx, group, results) }() } @@ -251,30 +246,19 @@ func (s *Store) writeConditional( s.writeConditionalBulk(ctx, operations, results) return } - workerCount := min(s.maxConcurrentWrites, len(operations)) - workChannel := make(chan writeWork) var workers sync.WaitGroup - workers.Add(workerCount) - for range workerCount { + workers.Add(len(operations)) + for _, operation := range operations { go func() { defer workers.Done() - for operation := range workChannel { - s.writeOne(ctx, operation, &results[operation.index]) - } + s.writeOne(ctx, operation, &results[operation.index]) }() } - for _, operation := range operations { - workChannel <- operation - } - close(workChannel) workers.Wait() } func (s *Store) writeOne(ctx context.Context, operation writeWork, result *storage.WriteResult) { - select { - case s.writes <- struct{}{}: - defer func() { <-s.writes }() - case <-ctx.Done(): + if ctx.Err() != nil { setWriteError(result, storage.BackendError(ctx.Err())) return } diff --git a/internal/storage/read_budget.go b/internal/storage/read_budget.go index 446d27b..ef001d7 100644 --- a/internal/storage/read_budget.go +++ b/internal/storage/read_budget.go @@ -40,7 +40,7 @@ func (b *ReadBudget) Reserve(size int) error { } b.mu.Lock() defer b.mu.Unlock() - // Include room for the per-operation protobuf envelope and revision. + // Include room for the per-operation protobuf envelope and internal revision. const overhead = 128 if size < 0 || b.remaining < overhead || size > b.remaining-overhead { cause := errors.New("read response exceeds its byte budget; request fewer or smaller records") diff --git a/proto/sink/sink.proto b/proto/sink/sink.proto index c3bd290..3a781da 100644 --- a/proto/sink/sink.proto +++ b/proto/sink/sink.proto @@ -38,11 +38,6 @@ enum DocumentEncoding { DOCUMENT_ENCODING_BSON = 2; } -// RevisionToken is interpreted only by the selected storage adapter. -message RevisionToken { - bytes data = 1; -} - // CompletionMode defines the point at which a mutating RPC returns success. enum CompletionMode { COMPLETION_MODE_UNSPECIFIED = 0; @@ -77,7 +72,6 @@ message ReadResult { uint32 operation_index = 1; ReadStatus status = 2; Document document = 3; - RevisionToken revision = 4; Failure failure = 5; } @@ -156,7 +150,6 @@ message WriteResponse { message WriteResult { uint32 operation_index = 1; WriteStatus status = 2; - RevisionToken revision = 3; Failure failure = 4; Document document = 5; }