couchbase 4.4.2 → 4.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. package/BUILDING.md +182 -0
  2. package/CMakeLists.txt +13 -0
  3. package/CONTRIBUTING.md +1 -1
  4. package/README.md +4 -2
  5. package/deps/couchbase-cxx-cache/boringssl/e31ea00c1ea52052d2d78d44006cc88c80fa24a9/boringssl/src/BUILDING.md +206 -0
  6. package/deps/couchbase-cxx-client/CMakeLists.txt +18 -13
  7. package/deps/couchbase-cxx-client/README.md +2 -2
  8. package/deps/couchbase-cxx-client/cmake/APKBUILD.in +54 -0
  9. package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +0 -5
  10. package/deps/couchbase-cxx-client/cmake/Packaging.cmake +177 -10
  11. package/deps/couchbase-cxx-client/cmake/RPath.cmake +10 -0
  12. package/deps/couchbase-cxx-client/cmake/Testing.cmake +1 -1
  13. package/deps/couchbase-cxx-client/cmake/VersionInfo.cmake +28 -2
  14. package/deps/couchbase-cxx-client/cmake/build_version.hxx.in +1 -0
  15. package/deps/couchbase-cxx-client/cmake/couchbase-cxx-client.spec.in +45 -6
  16. package/deps/couchbase-cxx-client/cmake/couchbase_cxx_client.pc.in +2 -2
  17. package/deps/couchbase-cxx-client/cmake/debian/changelog.in +5 -0
  18. package/deps/couchbase-cxx-client/cmake/debian/compat +1 -0
  19. package/deps/couchbase-cxx-client/cmake/debian/control +40 -0
  20. package/deps/couchbase-cxx-client/cmake/debian/rules +41 -0
  21. package/deps/couchbase-cxx-client/cmake/debian/source/format +1 -0
  22. package/deps/couchbase-cxx-client/core/agent_group.cxx +8 -0
  23. package/deps/couchbase-cxx-client/core/agent_group.hxx +4 -0
  24. package/deps/couchbase-cxx-client/core/bucket.cxx +16 -20
  25. package/deps/couchbase-cxx-client/core/bucket.hxx +12 -12
  26. package/deps/couchbase-cxx-client/core/cluster.cxx +44 -52
  27. package/deps/couchbase-cxx-client/core/cluster_agent.cxx +8 -0
  28. package/deps/couchbase-cxx-client/core/cluster_agent.hxx +4 -0
  29. package/deps/couchbase-cxx-client/core/collections_component.cxx +2 -2
  30. package/deps/couchbase-cxx-client/core/columnar/agent.cxx +2 -2
  31. package/deps/couchbase-cxx-client/core/columnar/agent.hxx +1 -1
  32. package/deps/couchbase-cxx-client/core/columnar/management_component.cxx +3 -3
  33. package/deps/couchbase-cxx-client/core/columnar/query_component.cxx +103 -45
  34. package/deps/couchbase-cxx-client/core/columnar/query_component.hxx +1 -0
  35. package/deps/couchbase-cxx-client/core/free_form_http_request.hxx +8 -0
  36. package/deps/couchbase-cxx-client/core/http_component.cxx +55 -24
  37. package/deps/couchbase-cxx-client/core/http_component.hxx +4 -0
  38. package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
  39. package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +15 -15
  40. package/deps/couchbase-cxx-client/core/impl/bootstrap_error.hxx +10 -2
  41. package/deps/couchbase-cxx-client/core/impl/bucket.cxx +1 -1
  42. package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +6 -6
  43. package/deps/couchbase-cxx-client/core/impl/cluster.cxx +36 -40
  44. package/deps/couchbase-cxx-client/core/impl/collection.cxx +29 -5
  45. package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +5 -5
  46. package/deps/couchbase-cxx-client/core/impl/error.cxx +24 -3
  47. package/deps/couchbase-cxx-client/core/impl/get_replica.hxx +2 -0
  48. package/deps/couchbase-cxx-client/core/impl/lookup_in_replica.hxx +2 -0
  49. package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +13 -5
  50. package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -3
  51. package/deps/couchbase-cxx-client/core/impl/observe_seqno.hxx +2 -0
  52. package/deps/couchbase-cxx-client/core/impl/query.cxx +1 -0
  53. package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
  54. package/deps/couchbase-cxx-client/core/impl/scan_result.cxx +1 -1
  55. package/deps/couchbase-cxx-client/core/impl/search.cxx +2 -0
  56. package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +12 -12
  57. package/deps/couchbase-cxx-client/core/io/http_command.hxx +31 -20
  58. package/deps/couchbase-cxx-client/core/io/http_session.cxx +5 -0
  59. package/deps/couchbase-cxx-client/core/io/http_session.hxx +17 -4
  60. package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +97 -49
  61. package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +15 -14
  62. package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
  63. package/deps/couchbase-cxx-client/core/io/streams.cxx +256 -0
  64. package/deps/couchbase-cxx-client/core/io/streams.hxx +31 -155
  65. package/deps/couchbase-cxx-client/core/logger/configuration.hxx +5 -0
  66. package/deps/couchbase-cxx-client/core/logger/custom_rotating_file_sink.cxx +2 -3
  67. package/deps/couchbase-cxx-client/core/logger/logger.cxx +39 -7
  68. package/deps/couchbase-cxx-client/core/logger/logger.hxx +7 -0
  69. package/deps/couchbase-cxx-client/core/meta/features.hxx +11 -0
  70. package/deps/couchbase-cxx-client/core/meta/version.cxx +47 -6
  71. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.cxx +188 -0
  72. package/deps/couchbase-cxx-client/core/metrics/meter_wrapper.hxx +73 -0
  73. package/deps/couchbase-cxx-client/core/operations/document_analytics.cxx +23 -17
  74. package/deps/couchbase-cxx-client/core/operations/document_analytics.hxx +1 -0
  75. package/deps/couchbase-cxx-client/core/operations/document_append.hxx +2 -0
  76. package/deps/couchbase-cxx-client/core/operations/document_decrement.hxx +2 -0
  77. package/deps/couchbase-cxx-client/core/operations/document_exists.hxx +2 -0
  78. package/deps/couchbase-cxx-client/core/operations/document_get.hxx +2 -0
  79. package/deps/couchbase-cxx-client/core/operations/document_get_all_replicas.hxx +2 -0
  80. package/deps/couchbase-cxx-client/core/operations/document_get_and_lock.hxx +2 -0
  81. package/deps/couchbase-cxx-client/core/operations/document_get_and_touch.hxx +2 -0
  82. package/deps/couchbase-cxx-client/core/operations/document_get_any_replica.hxx +2 -0
  83. package/deps/couchbase-cxx-client/core/operations/document_get_projected.hxx +2 -0
  84. package/deps/couchbase-cxx-client/core/operations/document_increment.hxx +2 -0
  85. package/deps/couchbase-cxx-client/core/operations/document_insert.hxx +2 -0
  86. package/deps/couchbase-cxx-client/core/operations/document_lookup_in.hxx +2 -0
  87. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +2 -0
  88. package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +2 -0
  89. package/deps/couchbase-cxx-client/core/operations/document_mutate_in.hxx +2 -0
  90. package/deps/couchbase-cxx-client/core/operations/document_prepend.hxx +2 -0
  91. package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -0
  92. package/deps/couchbase-cxx-client/core/operations/document_remove.hxx +2 -0
  93. package/deps/couchbase-cxx-client/core/operations/document_replace.hxx +2 -0
  94. package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -0
  95. package/deps/couchbase-cxx-client/core/operations/document_touch.hxx +2 -0
  96. package/deps/couchbase-cxx-client/core/operations/document_unlock.hxx +2 -0
  97. package/deps/couchbase-cxx-client/core/operations/document_upsert.hxx +2 -0
  98. package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
  99. package/deps/couchbase-cxx-client/core/operations/http_noop.hxx +2 -0
  100. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.hxx +1 -0
  101. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.hxx +1 -0
  102. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_get_all.hxx +1 -0
  103. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.hxx +1 -0
  104. package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.hxx +1 -0
  105. package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
  106. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_create.hxx +1 -0
  107. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.hxx +1 -0
  108. package/deps/couchbase-cxx-client/core/operations/management/analytics_index_get_all.hxx +1 -0
  109. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.hxx +1 -0
  110. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_create.hxx +1 -0
  111. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.hxx +1 -0
  112. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.hxx +1 -0
  113. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +23 -15
  114. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.hxx +4 -3
  115. package/deps/couchbase-cxx-client/core/operations/management/analytics_link_replace.hxx +1 -0
  116. package/deps/couchbase-cxx-client/core/operations/management/bucket_create.hxx +1 -0
  117. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -1
  118. package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.hxx +1 -0
  119. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +3 -1
  120. package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.hxx +1 -0
  121. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +3 -1
  122. package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.hxx +1 -0
  123. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +3 -1
  124. package/deps/couchbase-cxx-client/core/operations/management/bucket_get.hxx +1 -0
  125. package/deps/couchbase-cxx-client/core/operations/management/bucket_get_all.hxx +1 -0
  126. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.cxx +3 -1
  127. package/deps/couchbase-cxx-client/core/operations/management/bucket_update.hxx +1 -0
  128. package/deps/couchbase-cxx-client/core/operations/management/change_password.hxx +1 -0
  129. package/deps/couchbase-cxx-client/core/operations/management/cluster_describe.hxx +1 -0
  130. package/deps/couchbase-cxx-client/core/operations/management/cluster_developer_preview_enable.hxx +1 -0
  131. package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +3 -2
  132. package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +2 -0
  133. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +5 -2
  134. package/deps/couchbase-cxx-client/core/operations/management/collection_drop.hxx +1 -0
  135. package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +4 -2
  136. package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +2 -0
  137. package/deps/couchbase-cxx-client/core/operations/management/collections_manifest_get.hxx +2 -0
  138. package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.hxx +3 -2
  139. package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.hxx +3 -2
  140. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_all_functions.hxx +3 -2
  141. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.hxx +3 -2
  142. package/deps/couchbase-cxx-client/core/operations/management/eventing_get_status.hxx +3 -2
  143. package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.hxx +3 -2
  144. package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.hxx +3 -2
  145. package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.hxx +3 -2
  146. package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.hxx +3 -2
  147. package/deps/couchbase-cxx-client/core/operations/management/freeform.hxx +2 -0
  148. package/deps/couchbase-cxx-client/core/operations/management/group_drop.hxx +1 -0
  149. package/deps/couchbase-cxx-client/core/operations/management/group_get.hxx +1 -0
  150. package/deps/couchbase-cxx-client/core/operations/management/group_get_all.hxx +1 -0
  151. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.cxx +3 -3
  152. package/deps/couchbase-cxx-client/core/operations/management/group_upsert.hxx +1 -0
  153. package/deps/couchbase-cxx-client/core/operations/management/query_index_build.hxx +2 -0
  154. package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +3 -0
  155. package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -0
  156. package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.hxx +1 -0
  157. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +2 -0
  158. package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all_deferred.hxx +3 -0
  159. package/deps/couchbase-cxx-client/core/operations/management/role_get_all.hxx +1 -0
  160. package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -1
  161. package/deps/couchbase-cxx-client/core/operations/management/scope_create.hxx +1 -0
  162. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +4 -1
  163. package/deps/couchbase-cxx-client/core/operations/management/scope_drop.hxx +1 -0
  164. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +3 -1
  165. package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.hxx +1 -0
  166. package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +1 -0
  167. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +3 -2
  168. package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +1 -0
  169. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +3 -2
  170. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +1 -0
  171. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +3 -2
  172. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +1 -0
  173. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +3 -2
  174. package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +1 -0
  175. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +5 -2
  176. package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +1 -0
  177. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +5 -2
  178. package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +1 -0
  179. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +4 -2
  180. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +1 -0
  181. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +3 -2
  182. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +2 -0
  183. package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.hxx +1 -0
  184. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +5 -2
  185. package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +1 -0
  186. package/deps/couchbase-cxx-client/core/operations/management/user_drop.hxx +1 -0
  187. package/deps/couchbase-cxx-client/core/operations/management/user_get.hxx +1 -0
  188. package/deps/couchbase-cxx-client/core/operations/management/user_get_all.hxx +1 -0
  189. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.cxx +3 -3
  190. package/deps/couchbase-cxx-client/core/operations/management/user_upsert.hxx +1 -0
  191. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -1
  192. package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.hxx +1 -0
  193. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -1
  194. package/deps/couchbase-cxx-client/core/operations/management/view_index_get.hxx +1 -0
  195. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +3 -1
  196. package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.hxx +2 -0
  197. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -1
  198. package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.hxx +1 -0
  199. package/deps/couchbase-cxx-client/core/origin.cxx +37 -17
  200. package/deps/couchbase-cxx-client/core/platform/base64.cc +1 -1
  201. package/deps/couchbase-cxx-client/core/platform/random.cc +2 -0
  202. package/deps/couchbase-cxx-client/core/platform/uuid.h +6 -6
  203. package/deps/couchbase-cxx-client/core/row_streamer.cxx +1 -1
  204. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.cc +1 -1
  205. package/deps/couchbase-cxx-client/core/sasl/scram-sha/stringutils.h +4 -4
  206. package/deps/couchbase-cxx-client/core/topology/configuration.hxx +2 -0
  207. package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +8 -0
  208. package/deps/couchbase-cxx-client/core/tracing/constants.hxx +3 -0
  209. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.cxx +87 -0
  210. package/deps/couchbase-cxx-client/core/tracing/tracer_wrapper.hxx +57 -0
  211. package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.hxx +9 -21
  212. package/deps/couchbase-cxx-client/core/transactions/attempt_context.hxx +6 -33
  213. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +57 -56
  214. package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +17 -18
  215. package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +2 -2
  216. package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +2 -2
  217. package/deps/couchbase-cxx-client/core/transactions/transaction_get_result.hxx +0 -20
  218. package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +2 -2
  219. package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +128 -52
  220. package/deps/couchbase-cxx-client/couchbase/analytics_options.hxx +4 -3
  221. package/deps/couchbase-cxx-client/couchbase/codec/tao_json_serializer.hxx +1 -1
  222. package/deps/couchbase-cxx-client/couchbase/common_options.hxx +16 -1
  223. package/deps/couchbase-cxx-client/couchbase/metrics/otel_meter.hxx +16 -20
  224. package/deps/couchbase-cxx-client/couchbase/mutate_in_specs.hxx +2 -2
  225. package/deps/couchbase-cxx-client/couchbase/query_options.hxx +4 -3
  226. package/deps/couchbase-cxx-client/couchbase/search_options.hxx +1 -1
  227. package/dist/analyticsindexmanager.d.ts +98 -14
  228. package/dist/analyticsindexmanager.js +452 -411
  229. package/dist/binding.d.ts +53 -4
  230. package/dist/bindingutilities.d.ts +26 -1
  231. package/dist/bindingutilities.js +108 -1
  232. package/dist/couchbase.d.ts +3 -1
  233. package/dist/couchbase.js +2 -0
  234. package/dist/rangeScan.d.ts +1 -1
  235. package/dist/rangeScan.js +1 -1
  236. package/dist/transactions.d.ts +34 -3
  237. package/dist/transactions.js +25 -18
  238. package/dist/transcoders.d.ts +68 -0
  239. package/dist/transcoders.js +194 -1
  240. package/dist/usermanager.d.ts +14 -14
  241. package/dist/usermanager.js +178 -228
  242. package/dist/utilities.js +4 -6
  243. package/dist/utilities_internal.js +1 -2
  244. package/package.json +9 -8
  245. package/src/binding.cpp +13 -13
  246. package/src/connection.cpp +22 -0
  247. package/src/connection.hpp +12 -0
  248. package/src/connection_autogen.cpp +100 -0
  249. package/src/jstocbpp_autogen.hpp +315 -8
  250. package/src/jstocbpp_transactions.hpp +1 -2
  251. package/tools/gen-bindings-js.js +38 -3
  252. package/tools/gen-bindings-json.py +575 -328
@@ -149,6 +149,7 @@ public:
149
149
  {},
150
150
  options.timeout,
151
151
  { options.retry_strategy },
152
+ options.parent_span,
152
153
  },
153
154
  [handler = std::move(handler)](auto resp) mutable {
154
155
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -166,6 +167,7 @@ public:
166
167
  false,
167
168
  options.timeout,
168
169
  { options.retry_strategy },
170
+ options.parent_span,
169
171
  },
170
172
  [handler = std::move(handler)](auto resp) mutable {
171
173
  std::optional<std::chrono::system_clock::time_point> expiry_time{};
@@ -190,6 +192,7 @@ public:
190
192
  expiry,
191
193
  options.timeout,
192
194
  { options.retry_strategy },
195
+ options.parent_span,
193
196
  },
194
197
  [handler = std::move(handler)](auto resp) mutable {
195
198
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -210,8 +213,9 @@ public:
210
213
  expiry,
211
214
  options.timeout,
212
215
  { options.retry_strategy },
216
+ options.parent_span,
213
217
  },
214
- [handler = std::move(handler)](auto resp) mutable {
218
+ [handler = std::move(handler)](const auto& resp) mutable {
215
219
  return handler(core::impl::make_error(std::move(resp.ctx)), result{ resp.cas });
216
220
  });
217
221
  }
@@ -279,6 +283,7 @@ public:
279
283
  options.durability_level,
280
284
  options.timeout,
281
285
  { options.retry_strategy },
286
+ options.parent_span,
282
287
  },
283
288
  [handler = std::move(handler)](auto resp) mutable {
284
289
  if (resp.ctx.ec()) {
@@ -290,7 +295,14 @@ public:
290
295
  }
291
296
 
292
297
  core::operations::remove_request request{
293
- id, {}, {}, options.cas, durability_level::none, options.timeout, { options.retry_strategy },
298
+ id,
299
+ {},
300
+ {},
301
+ options.cas,
302
+ durability_level::none,
303
+ options.timeout,
304
+ { options.retry_strategy },
305
+ options.parent_span,
294
306
  };
295
307
  return core_.execute(std::move(request),
296
308
  [core = core_, id = std::move(id), options, handler = std::move(handler)](
@@ -332,6 +344,7 @@ public:
332
344
  static_cast<uint32_t>(lock_duration.count()),
333
345
  options.timeout,
334
346
  { options.retry_strategy },
347
+ options.parent_span,
335
348
  },
336
349
  [handler = std::move(handler)](auto&& resp) mutable {
337
350
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -352,6 +365,7 @@ public:
352
365
  cas,
353
366
  options.timeout,
354
367
  { options.retry_strategy },
368
+ options.parent_span,
355
369
  },
356
370
  [handler = std::move(handler)](auto&& resp) mutable {
357
371
  return handler(core::impl::make_error(std::move(resp.ctx)));
@@ -369,6 +383,7 @@ public:
369
383
  {},
370
384
  options.timeout,
371
385
  { options.retry_strategy },
386
+ options.parent_span,
372
387
  },
373
388
  [handler = std::move(handler)](auto&& resp) mutable {
374
389
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -395,6 +410,7 @@ public:
395
410
  specs,
396
411
  options.timeout,
397
412
  { options.retry_strategy },
413
+ options.parent_span,
398
414
  },
399
415
  [handler = std::move(handler)](auto resp) mutable {
400
416
  if (resp.ctx.ec()) {
@@ -427,7 +443,7 @@ public:
427
443
  core::document_id{ bucket_name_, scope_name_, name_, std::move(document_key) },
428
444
  specs,
429
445
  options.timeout,
430
- {},
446
+ options.parent_span,
431
447
  options.read_preference,
432
448
  },
433
449
  [handler = std::move(handler)](auto resp) mutable {
@@ -465,7 +481,7 @@ public:
465
481
  core::document_id{ bucket_name_, scope_name_, name_, std::move(document_key) },
466
482
  specs,
467
483
  options.timeout,
468
- {},
484
+ options.parent_span,
469
485
  options.read_preference,
470
486
  },
471
487
  [handler = std::move(handler)](auto resp) mutable {
@@ -514,6 +530,7 @@ public:
514
530
  options.timeout,
515
531
  { options.retry_strategy },
516
532
  options.preserve_expiry,
533
+ options.parent_span,
517
534
  },
518
535
  [handler = std::move(handler)](auto resp) mutable {
519
536
  if (resp.ctx.ec()) {
@@ -548,6 +565,7 @@ public:
548
565
  options.timeout,
549
566
  { options.retry_strategy },
550
567
  options.preserve_expiry,
568
+ options.parent_span,
551
569
  };
552
570
  return core_.execute(
553
571
  std::move(request),
@@ -611,6 +629,7 @@ public:
611
629
  options.timeout,
612
630
  { options.retry_strategy },
613
631
  options.preserve_expiry,
632
+ options.parent_span,
614
633
  },
615
634
  [handler = std::move(handler)](auto resp) mutable {
616
635
  return handler(core::impl::make_error(std::move(resp.ctx)),
@@ -629,6 +648,7 @@ public:
629
648
  options.timeout,
630
649
  { options.retry_strategy },
631
650
  options.preserve_expiry,
651
+ options.parent_span,
632
652
  };
633
653
  return core_.execute(
634
654
  std::move(request),
@@ -681,6 +701,7 @@ public:
681
701
  options.durability_level,
682
702
  options.timeout,
683
703
  { options.retry_strategy },
704
+ options.parent_span,
684
705
  },
685
706
  [handler = std::move(handler)](auto&& resp) mutable {
686
707
  if (resp.ctx.ec()) {
@@ -701,6 +722,7 @@ public:
701
722
  durability_level::none,
702
723
  options.timeout,
703
724
  { options.retry_strategy },
725
+ options.parent_span,
704
726
  };
705
727
  return core_.execute(
706
728
  std::move(request),
@@ -754,6 +776,7 @@ public:
754
776
  options.timeout,
755
777
  { options.retry_strategy },
756
778
  options.preserve_expiry,
779
+ options.parent_span,
757
780
  },
758
781
  [handler = std::move(handler)](auto resp) mutable {
759
782
  if (resp.ctx.ec()) {
@@ -776,6 +799,7 @@ public:
776
799
  options.timeout,
777
800
  { options.retry_strategy },
778
801
  options.preserve_expiry,
802
+ options.parent_span,
779
803
  };
780
804
  return core_.execute(std::move(request),
781
805
  [core = core_, id = std::move(id), options, handler = std::move(handler)](
@@ -1390,7 +1414,7 @@ collection::scan(const couchbase::scan_type& scan_type, const couchbase::scan_op
1390
1414
  {
1391
1415
  auto barrier = std::make_shared<std::promise<std::pair<error, scan_result>>>();
1392
1416
  auto future = barrier->get_future();
1393
- scan(scan_type, options, [barrier](auto err, auto result) {
1417
+ scan(scan_type, options, [barrier](const auto& err, auto result) {
1394
1418
  barrier->set_value({ err, std::move(result) });
1395
1419
  });
1396
1420
  return future;
@@ -101,7 +101,7 @@ public:
101
101
  {},
102
102
  options.timeout,
103
103
  },
104
- [handler = std::move(handler)](auto resp) mutable {
104
+ [handler = std::move(handler)](const auto& resp) mutable {
105
105
  return handler(core::impl::make_error(resp.ctx));
106
106
  });
107
107
  }
@@ -122,7 +122,7 @@ public:
122
122
  {},
123
123
  options.timeout,
124
124
  },
125
- [handler = std::move(handler)](auto resp) mutable {
125
+ [handler = std::move(handler)](const auto& resp) mutable {
126
126
  return handler(core::impl::make_error(resp.ctx));
127
127
  });
128
128
  }
@@ -143,7 +143,7 @@ public:
143
143
  {},
144
144
  options.timeout,
145
145
  },
146
- [handler = std::move(handler)](auto resp) mutable {
146
+ [handler = std::move(handler)](const auto& resp) mutable {
147
147
  return handler(core::impl::make_error(resp.ctx));
148
148
  });
149
149
  }
@@ -173,7 +173,7 @@ public:
173
173
  {},
174
174
  options.timeout,
175
175
  },
176
- [handler = std::move(handler)](auto resp) mutable {
176
+ [handler = std::move(handler)](const auto& resp) mutable {
177
177
  return handler(core::impl::make_error(resp.ctx));
178
178
  });
179
179
  }
@@ -189,7 +189,7 @@ public:
189
189
  {},
190
190
  options.timeout,
191
191
  },
192
- [handler = std::move(handler)](auto resp) mutable {
192
+ [handler = std::move(handler)](const auto& resp) mutable {
193
193
  return handler(core::impl::make_error(resp.ctx));
194
194
  });
195
195
  }
@@ -115,59 +115,80 @@ namespace core::impl
115
115
  auto
116
116
  make_error(const core::error_context::query& core_ctx) -> error
117
117
  {
118
+ if (!core_ctx.ec) {
119
+ return {};
120
+ }
118
121
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
119
122
  }
120
123
 
121
124
  auto
122
125
  make_error(const query_error_context& core_ctx) -> error
123
126
  {
127
+ if (!core_ctx.ec()) {
128
+ return {};
129
+ }
124
130
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
125
131
  }
126
132
 
127
133
  auto
128
134
  make_error(const core::error_context::search& core_ctx) -> error
129
135
  {
136
+ if (!core_ctx.ec) {
137
+ return {};
138
+ }
130
139
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
131
140
  }
132
141
 
133
142
  auto
134
143
  make_error(const core::error_context::analytics& core_ctx) -> error
135
144
  {
145
+ if (!core_ctx.ec) {
146
+ return {};
147
+ }
136
148
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
137
149
  }
138
150
 
139
151
  auto
140
152
  make_error(const core::error_context::http& core_ctx) -> error
141
153
  {
154
+ if (!core_ctx.ec) {
155
+ return {};
156
+ }
142
157
  return { core_ctx.ec, {}, internal_error_context::build_error_context(core_ctx) };
143
158
  }
144
159
 
145
160
  auto
146
161
  make_error(const couchbase::core::key_value_error_context& core_ctx) -> error
147
162
  {
163
+ if (!core_ctx.ec()) {
164
+ return {};
165
+ }
148
166
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
149
167
  }
150
168
 
151
169
  auto
152
170
  make_error(const couchbase::core::subdocument_error_context& core_ctx) -> error
153
171
  {
172
+ if (!core_ctx.ec()) {
173
+ return {};
174
+ }
154
175
  return { core_ctx.ec(), {}, internal_error_context::build_error_context(core_ctx) };
155
176
  }
156
177
 
157
178
  auto
158
179
  make_error(const couchbase::core::transaction_error_context& ctx) -> error
159
180
  {
160
- return { ctx.ec(), "", {}, { ctx.cause() } };
181
+ return { ctx.ec(), {}, {}, { ctx.cause() } };
161
182
  }
162
183
 
163
184
  auto
164
185
  make_error(const couchbase::core::transaction_op_error_context& ctx) -> error
165
186
  {
166
187
  if (std::holds_alternative<key_value_error_context>(ctx.cause())) {
167
- return { ctx.ec(), "", {}, make_error(std::get<key_value_error_context>(ctx.cause())) };
188
+ return { ctx.ec(), {}, {}, make_error(std::get<key_value_error_context>(ctx.cause())) };
168
189
  }
169
190
  if (std::holds_alternative<query_error_context>(ctx.cause())) {
170
- return { ctx.ec(), "", {}, make_error(std::get<query_error_context>(ctx.cause())) };
191
+ return { ctx.ec(), {}, {}, make_error(std::get<query_error_context>(ctx.cause())) };
171
192
  }
172
193
  return ctx.ec();
173
194
  }
@@ -41,6 +41,8 @@ struct get_replica_request {
41
41
  using encoded_response_type =
42
42
  core::protocol::client_response<core::protocol::get_replica_response_body>;
43
43
 
44
+ static const inline std::string observability_identifier = "get_replica";
45
+
44
46
  core::document_id id;
45
47
  std::optional<std::chrono::milliseconds> timeout{};
46
48
  std::uint16_t partition{};
@@ -53,6 +53,8 @@ struct lookup_in_replica_request {
53
53
  using encoded_response_type =
54
54
  protocol::client_response<protocol::lookup_in_replica_response_body>;
55
55
 
56
+ static const inline std::string observability_identifier = "lookup_in_replica";
57
+
56
58
  document_id id;
57
59
  std::vector<couchbase::core::impl::subdoc::command> specs{};
58
60
  std::optional<std::chrono::milliseconds> timeout{};
@@ -26,6 +26,7 @@
26
26
 
27
27
  #include <memory>
28
28
  #include <mutex>
29
+ #include <system_error>
29
30
 
30
31
  namespace couchbase::core::impl
31
32
  {
@@ -240,8 +241,7 @@ public:
240
241
  void handle_response(observe_seqno_response&& response)
241
242
  {
242
243
  --expect_number_of_responses_;
243
- auto r = std::move(response);
244
- status_.examine(r);
244
+ status_.examine(response);
245
245
  maybe_finish();
246
246
  }
247
247
 
@@ -249,6 +249,8 @@ public:
249
249
  {
250
250
  poll_backoff_.cancel();
251
251
  poll_deadline_.cancel();
252
+ on_last_response(0, [](std::error_code) {
253
+ });
252
254
  observe_handler handler{};
253
255
  {
254
256
  const std::scoped_lock lock(handler_mutex_);
@@ -268,10 +270,16 @@ public:
268
270
  return;
269
271
  }
270
272
  if (status_.meets_condition(persist_to_, replicate_to_)) {
273
+ poll_backoff_.cancel();
274
+ poll_deadline_.cancel();
275
+ on_last_response(0, [](std::error_code) {
276
+ });
271
277
  std::swap(handler_, handler);
272
- } else if (expect_number_of_responses_ == 0 && on_last_response_) {
273
- poll_backoff_.expires_after(poll_backoff_interval_);
274
- return poll_backoff_.async_wait(std::move(on_last_response_));
278
+ } else if (expect_number_of_responses_ == 0) {
279
+ if (auto on_last_response = std::move(on_last_response_); on_last_response) {
280
+ poll_backoff_.expires_after(poll_backoff_interval_);
281
+ return poll_backoff_.async_wait(std::move(on_last_response));
282
+ }
275
283
  }
276
284
  }
277
285
  if (handler) {
@@ -17,7 +17,6 @@
17
17
 
18
18
  #pragma once
19
19
 
20
- #include "core/error_context/key_value_error_context.hxx"
21
20
  #include <couchbase/mutation_token.hxx>
22
21
  #include <couchbase/persist_to.hxx>
23
22
  #include <couchbase/replicate_to.hxx>
@@ -26,8 +25,7 @@
26
25
  #include "core/utils/movable_function.hxx"
27
26
 
28
27
  #include <chrono>
29
- #include <functional>
30
- #include <memory>
28
+ #include <system_error>
31
29
 
32
30
  namespace couchbase::core
33
31
  {
@@ -50,6 +50,8 @@ struct observe_seqno_request {
50
50
  using encoded_response_type =
51
51
  core::protocol::client_response<core::protocol::observe_seqno_response_body>;
52
52
 
53
+ static const inline std::string observability_identifier = "observe_seqno";
54
+
53
55
  core::document_id id;
54
56
  bool active{};
55
57
  std::uint64_t partition_uuid{};
@@ -180,6 +180,7 @@ build_query_request(std::string statement,
180
180
  std::move(query_context), std::move(options.client_context_id),
181
181
  options.timeout, options.profile,
182
182
  };
183
+ request.parent_span = options.parent_span;
183
184
  if (!options.raw.empty()) {
184
185
  for (auto& [name, value] : options.raw) {
185
186
  request.raw[name] = std::move(value);
@@ -232,7 +232,7 @@ public:
232
232
  {},
233
233
  options.timeout,
234
234
  },
235
- [handler = std::move(handler)](auto resp) {
235
+ [handler = std::move(handler)](const auto& resp) {
236
236
  handler(core::impl::make_error(resp.ctx));
237
237
  });
238
238
  }
@@ -259,7 +259,7 @@ public:
259
259
  {},
260
260
  options.timeout,
261
261
  },
262
- [handler = std::move(handler)](auto resp) {
262
+ [handler = std::move(handler)](const auto& resp) {
263
263
  handler(core::impl::make_error(resp.ctx));
264
264
  });
265
265
  }
@@ -283,7 +283,7 @@ public:
283
283
  {},
284
284
  options.timeout,
285
285
  },
286
- [handler = std::move(handler)](auto resp) {
286
+ [handler = std::move(handler)](const auto& resp) {
287
287
  handler(core::impl::make_error(resp.ctx));
288
288
  });
289
289
  }
@@ -342,7 +342,7 @@ public:
342
342
  std::move(list_resp.index_names),
343
343
  {},
344
344
  timeout },
345
- [handler = std::move(handler)](auto build_resp) {
345
+ [handler = std::move(handler)](const auto& build_resp) {
346
346
  return handler(core::impl::make_error(build_resp.ctx));
347
347
  });
348
348
  });
@@ -390,7 +390,7 @@ query_index_manager::get_all_indexes(const std::string& bucket_name,
390
390
  auto barrier =
391
391
  std::make_shared<std::promise<std::pair<error, std::vector<management::query_index>>>>();
392
392
  auto future = barrier->get_future();
393
- get_all_indexes(bucket_name, options, [barrier](auto err, auto resp) mutable {
393
+ get_all_indexes(bucket_name, options, [barrier](auto err, const auto& resp) mutable {
394
394
  barrier->set_value({ std::move(err), resp });
395
395
  });
396
396
  return future;
@@ -563,7 +563,7 @@ collection_query_index_manager::get_all_indexes(const get_all_query_indexes_opti
563
563
  auto barrier =
564
564
  std::make_shared<std::promise<std::pair<error, std::vector<management::query_index>>>>();
565
565
  auto future = barrier->get_future();
566
- get_all_indexes(options, [barrier](auto err, auto resp) mutable {
566
+ get_all_indexes(options, [barrier](auto err, const auto& resp) mutable {
567
567
  barrier->set_value({ std::move(err), resp });
568
568
  });
569
569
  return future;
@@ -97,7 +97,7 @@ scan_result::next() const -> std::future<std::pair<error, std::optional<scan_res
97
97
  {
98
98
  auto barrier =
99
99
  std::make_shared<std::promise<std::pair<error, std::optional<scan_result_item>>>>();
100
- internal_->next([barrier](auto err, auto item) mutable {
100
+ internal_->next([barrier](const auto& err, const auto& item) mutable {
101
101
  barrier->set_value({ err, item });
102
102
  });
103
103
  return barrier->get_future();
@@ -165,6 +165,7 @@ build_search_request(std::string index_name,
165
165
  options.client_context_id,
166
166
  options.timeout,
167
167
  };
168
+ request.parent_span = options.parent_span;
168
169
  return request;
169
170
  }
170
171
 
@@ -207,6 +208,7 @@ build_search_request(std::string index_name,
207
208
  options.client_context_id,
208
209
  options.timeout,
209
210
  };
211
+ core_request.parent_span = options.parent_span;
210
212
 
211
213
  if (auto vector_search = request.vector_search(); vector_search.has_value()) {
212
214
  core_request.vector_search = core::utils::json::generate_binary(vector_search->query);
@@ -150,7 +150,7 @@ public:
150
150
  core_.execute(
151
151
  core::operations::management::search_index_get_request{
152
152
  std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
153
- [handler = std::move(handler)](auto resp) mutable {
153
+ [handler = std::move(handler)](const auto& resp) mutable {
154
154
  return handler(core::impl::make_error(resp.ctx), map_search_index(resp.index));
155
155
  });
156
156
  }
@@ -161,7 +161,7 @@ public:
161
161
  core_.execute(
162
162
  core::operations::management::search_index_get_all_request{
163
163
  bucket_name_, scope_name_, {}, options.timeout },
164
- [handler = std::move(handler)](auto resp) mutable {
164
+ [handler = std::move(handler)](const auto& resp) mutable {
165
165
  return handler(core::impl::make_error(resp.ctx), map_all_search_indexes(resp.indexes));
166
166
  });
167
167
  }
@@ -173,7 +173,7 @@ public:
173
173
  core_.execute(
174
174
  core::operations::management::search_index_upsert_request{
175
175
  map_search_index(search_index), bucket_name_, scope_name_, {}, options.timeout },
176
- [handler = std::move(handler)](auto resp) mutable {
176
+ [handler = std::move(handler)](const auto& resp) mutable {
177
177
  return handler(core::impl::make_error(resp.ctx));
178
178
  });
179
179
  }
@@ -185,7 +185,7 @@ public:
185
185
  core_.execute(
186
186
  core::operations::management::search_index_drop_request{
187
187
  std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
188
- [handler = std::move(handler)](auto resp) mutable {
188
+ [handler = std::move(handler)](const auto& resp) mutable {
189
189
  return handler(core::impl::make_error(resp.ctx));
190
190
  });
191
191
  }
@@ -197,7 +197,7 @@ public:
197
197
  core_.execute(
198
198
  core::operations::management::search_index_get_documents_count_request{
199
199
  std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
200
- [handler = std::move(handler)](auto resp) mutable {
200
+ [handler = std::move(handler)](const auto& resp) mutable {
201
201
  return handler(core::impl::make_error(resp.ctx), resp.count);
202
202
  });
203
203
  }
@@ -209,7 +209,7 @@ public:
209
209
  core_.execute(
210
210
  core::operations::management::search_index_control_ingest_request{
211
211
  std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
212
- [handler = std::move(handler)](auto resp) mutable {
212
+ [handler = std::move(handler)](const auto& resp) mutable {
213
213
  return handler(core::impl::make_error(resp.ctx));
214
214
  });
215
215
  }
@@ -221,7 +221,7 @@ public:
221
221
  core_.execute(
222
222
  core::operations::management::search_index_control_ingest_request{
223
223
  std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
224
- [handler = std::move(handler)](auto resp) mutable {
224
+ [handler = std::move(handler)](const auto& resp) mutable {
225
225
  return handler(core::impl::make_error(resp.ctx));
226
226
  });
227
227
  }
@@ -233,7 +233,7 @@ public:
233
233
  core_.execute(
234
234
  core::operations::management::search_index_control_query_request{
235
235
  std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
236
- [handler = std::move(handler)](auto resp) mutable {
236
+ [handler = std::move(handler)](const auto& resp) mutable {
237
237
  return handler(core::impl::make_error(resp.ctx));
238
238
  });
239
239
  }
@@ -245,7 +245,7 @@ public:
245
245
  core_.execute(
246
246
  core::operations::management::search_index_control_query_request{
247
247
  std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
248
- [handler = std::move(handler)](auto resp) mutable {
248
+ [handler = std::move(handler)](const auto& resp) mutable {
249
249
  return handler(core::impl::make_error(resp.ctx));
250
250
  });
251
251
  }
@@ -257,7 +257,7 @@ public:
257
257
  core_.execute(
258
258
  core::operations::management::search_index_control_plan_freeze_request{
259
259
  std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
260
- [handler = std::move(handler)](auto resp) mutable {
260
+ [handler = std::move(handler)](const auto& resp) mutable {
261
261
  return handler(core::impl::make_error(resp.ctx));
262
262
  });
263
263
  }
@@ -269,7 +269,7 @@ public:
269
269
  core_.execute(
270
270
  core::operations::management::search_index_control_plan_freeze_request{
271
271
  std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
272
- [handler = std::move(handler)](auto resp) mutable {
272
+ [handler = std::move(handler)](const auto& resp) mutable {
273
273
  return handler(core::impl::make_error(resp.ctx));
274
274
  });
275
275
  }
@@ -286,7 +286,7 @@ public:
286
286
  scope_name_,
287
287
  {},
288
288
  options.timeout },
289
- [handler = std::move(handler)](auto resp) mutable {
289
+ [handler = std::move(handler)](const auto& resp) mutable {
290
290
  return handler(core::impl::make_error(resp.ctx), convert_analysis(resp.analysis));
291
291
  });
292
292
  }