couchbase 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2228) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -13
  3. data/ext/couchbase/CMakeLists.txt +372 -86
  4. data/ext/couchbase/cmake/CompilerWarnings.cmake +19 -4
  5. data/ext/couchbase/cmake/Documentation.cmake +36 -0
  6. data/ext/couchbase/cmake/OpenSSL.cmake +73 -5
  7. data/ext/couchbase/cmake/Testing.cmake +61 -0
  8. data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +1 -0
  9. data/ext/couchbase/cmake/VersionInfo.cmake +52 -4
  10. data/ext/couchbase/cmake/build_version.hxx.in +3 -0
  11. data/ext/couchbase/cmake/test_openssl.cxx +7 -0
  12. data/ext/couchbase/core/CMakeLists.txt +0 -0
  13. data/ext/couchbase/core/agent.cxx +556 -0
  14. data/ext/couchbase/core/agent.hxx +165 -0
  15. data/ext/couchbase/core/agent_config.cxx +36 -0
  16. data/ext/couchbase/core/agent_config.hxx +44 -0
  17. data/ext/couchbase/core/agent_group.cxx +219 -0
  18. data/ext/couchbase/core/agent_group.hxx +79 -0
  19. data/ext/couchbase/core/agent_group_config.cxx +35 -0
  20. data/ext/couchbase/core/agent_group_config.hxx +45 -0
  21. data/ext/couchbase/core/agent_unit_test_api.hxx +37 -0
  22. data/ext/couchbase/core/analytics_query_options.cxx +72 -0
  23. data/ext/couchbase/core/analytics_query_options.hxx +74 -0
  24. data/ext/couchbase/core/analytics_scan_consistency.hxx +26 -0
  25. data/ext/couchbase/core/bucket.cxx +891 -0
  26. data/ext/couchbase/core/bucket.hxx +172 -0
  27. data/ext/couchbase/core/capella_ca.hxx +43 -0
  28. data/ext/couchbase/core/cluster.cxx +181 -0
  29. data/ext/couchbase/core/cluster.hxx +496 -0
  30. data/ext/couchbase/core/cluster_agent.cxx +36 -0
  31. data/ext/couchbase/core/cluster_agent.hxx +34 -0
  32. data/ext/couchbase/core/cluster_agent_config.cxx +35 -0
  33. data/ext/couchbase/core/cluster_agent_config.hxx +43 -0
  34. data/ext/couchbase/core/cluster_options.cxx +50 -0
  35. data/ext/couchbase/core/cluster_options.hxx +93 -0
  36. data/ext/couchbase/core/cluster_state.hxx +25 -0
  37. data/ext/couchbase/core/collection_id_cache_entry.hxx +37 -0
  38. data/ext/couchbase/core/collections_component.cxx +439 -0
  39. data/ext/couchbase/core/collections_component.hxx +81 -0
  40. data/ext/couchbase/core/collections_component_unit_test_api.hxx +36 -0
  41. data/ext/couchbase/core/collections_options.hxx +87 -0
  42. data/ext/couchbase/core/config_listener.hxx +31 -0
  43. data/ext/couchbase/core/config_profile.cxx +25 -0
  44. data/ext/couchbase/core/config_profile.hxx +92 -0
  45. data/ext/couchbase/core/core_sdk_shim.cxx +28 -0
  46. data/ext/couchbase/core/core_sdk_shim.hxx +30 -0
  47. data/ext/couchbase/core/crud_component.cxx +367 -0
  48. data/ext/couchbase/core/crud_component.hxx +60 -0
  49. data/ext/couchbase/core/crud_options.hxx +574 -0
  50. data/ext/couchbase/core/crypto/CMakeLists.txt +16 -0
  51. data/ext/couchbase/core/crypto/cbcrypto.cc +897 -0
  52. data/ext/couchbase/core/crypto/cbcrypto.h +88 -0
  53. data/ext/couchbase/core/design_document_namespace.hxx +26 -0
  54. data/ext/couchbase/core/design_document_namespace_fmt.hxx +47 -0
  55. data/ext/couchbase/core/diagnostics.hxx +97 -0
  56. data/ext/couchbase/core/diagnostics_fmt.hxx +113 -0
  57. data/ext/couchbase/core/diagnostics_json.hxx +100 -0
  58. data/ext/couchbase/core/diagntostics_options.hxx +55 -0
  59. data/ext/couchbase/core/dispatcher.cxx +37 -0
  60. data/ext/couchbase/core/dispatcher.hxx +43 -0
  61. data/ext/couchbase/core/document_id.cxx +102 -0
  62. data/ext/couchbase/core/document_id.hxx +119 -0
  63. data/ext/couchbase/core/document_id_fmt.hxx +37 -0
  64. data/ext/couchbase/core/durability_options.hxx +110 -0
  65. data/ext/couchbase/core/error_context/analytics.hxx +52 -0
  66. data/ext/couchbase/core/error_context/http.hxx +48 -0
  67. data/ext/couchbase/core/error_context/key_value.cxx +58 -0
  68. data/ext/couchbase/core/error_context/key_value.hxx +83 -0
  69. data/ext/couchbase/core/error_context/query.hxx +52 -0
  70. data/ext/couchbase/core/error_context/search.hxx +51 -0
  71. data/ext/couchbase/core/error_context/view.hxx +52 -0
  72. data/ext/couchbase/core/free_form_http_request.cxx +81 -0
  73. data/ext/couchbase/core/free_form_http_request.hxx +90 -0
  74. data/ext/couchbase/core/impl/analytics_error_category.cxx +62 -0
  75. data/ext/couchbase/core/impl/append.cxx +87 -0
  76. data/ext/couchbase/core/impl/best_effort_retry_strategy.cxx +109 -0
  77. data/ext/couchbase/core/impl/bootstrap_state_listener.hxx +39 -0
  78. data/ext/couchbase/core/impl/build_deferred_query_indexes.cxx +92 -0
  79. data/ext/couchbase/core/impl/cluster.cxx +185 -0
  80. data/ext/couchbase/core/impl/collection_query_index_manager.cxx +93 -0
  81. data/ext/couchbase/core/impl/common_error_category.cxx +88 -0
  82. data/ext/couchbase/core/impl/configuration_profiles_registry.cxx +73 -0
  83. data/ext/couchbase/core/impl/create_query_index.cxx +119 -0
  84. data/ext/couchbase/core/impl/decrement.cxx +96 -0
  85. data/ext/couchbase/core/impl/dns_srv_tracker.cxx +147 -0
  86. data/ext/couchbase/core/impl/dns_srv_tracker.hxx +68 -0
  87. data/ext/couchbase/core/impl/drop_query_index.cxx +108 -0
  88. data/ext/couchbase/core/impl/exists.cxx +47 -0
  89. data/ext/couchbase/core/impl/expiry.cxx +99 -0
  90. data/ext/couchbase/core/impl/fail_fast_retry_strategy.cxx +41 -0
  91. data/ext/couchbase/core/impl/field_level_encryption_error_category.cxx +63 -0
  92. data/ext/couchbase/core/impl/get.cxx +68 -0
  93. data/ext/couchbase/core/impl/get_all_query_indexes.cxx +76 -0
  94. data/ext/couchbase/core/impl/get_all_replicas.cxx +145 -0
  95. data/ext/couchbase/core/impl/get_all_replicas.hxx +79 -0
  96. data/ext/couchbase/core/impl/get_and_lock.cxx +49 -0
  97. data/ext/couchbase/core/impl/get_and_touch.cxx +49 -0
  98. data/ext/couchbase/core/impl/get_any_replica.cxx +134 -0
  99. data/ext/couchbase/core/impl/get_any_replica.hxx +76 -0
  100. data/ext/couchbase/core/impl/get_replica.cxx +44 -0
  101. data/ext/couchbase/core/impl/get_replica.hxx +52 -0
  102. data/ext/couchbase/core/impl/increment.cxx +96 -0
  103. data/ext/couchbase/core/impl/insert.cxx +90 -0
  104. data/ext/couchbase/core/impl/key_value_error_category.cxx +105 -0
  105. data/ext/couchbase/core/impl/lookup_in.cxx +68 -0
  106. data/ext/couchbase/core/impl/management_error_category.cxx +75 -0
  107. data/ext/couchbase/core/impl/mutate_in.cxx +125 -0
  108. data/ext/couchbase/core/impl/network_error_category.cxx +73 -0
  109. data/ext/couchbase/core/impl/observe_poll.cxx +355 -0
  110. data/ext/couchbase/core/impl/observe_poll.hxx +49 -0
  111. data/ext/couchbase/core/impl/observe_seqno.cxx +47 -0
  112. data/ext/couchbase/core/impl/observe_seqno.hxx +63 -0
  113. data/ext/couchbase/core/impl/prepend.cxx +87 -0
  114. data/ext/couchbase/core/impl/query.cxx +245 -0
  115. data/ext/couchbase/core/impl/query_error_category.cxx +55 -0
  116. data/ext/couchbase/core/impl/remove.cxx +86 -0
  117. data/ext/couchbase/core/impl/replace.cxx +102 -0
  118. data/ext/couchbase/core/impl/retry_action.cxx +39 -0
  119. data/ext/couchbase/core/impl/retry_reason.cxx +85 -0
  120. data/ext/couchbase/core/impl/search_error_category.cxx +51 -0
  121. data/ext/couchbase/core/impl/streaming_json_lexter_error_category.cxx +102 -0
  122. data/ext/couchbase/core/impl/subdoc/array_add_unique.cxx +36 -0
  123. data/ext/couchbase/core/impl/subdoc/array_append.cxx +37 -0
  124. data/ext/couchbase/core/impl/subdoc/array_insert.cxx +37 -0
  125. data/ext/couchbase/core/impl/subdoc/array_prepend.cxx +37 -0
  126. data/ext/couchbase/core/impl/subdoc/command.hxx +41 -0
  127. data/ext/couchbase/core/impl/subdoc/command_bundle.hxx +42 -0
  128. data/ext/couchbase/core/impl/subdoc/count.cxx +36 -0
  129. data/ext/couchbase/core/impl/subdoc/counter.cxx +37 -0
  130. data/ext/couchbase/core/impl/subdoc/exists.cxx +36 -0
  131. data/ext/couchbase/core/impl/subdoc/get.cxx +36 -0
  132. data/ext/couchbase/core/impl/subdoc/insert.cxx +36 -0
  133. data/ext/couchbase/core/impl/subdoc/join_values.cxx +56 -0
  134. data/ext/couchbase/core/impl/subdoc/join_values.hxx +27 -0
  135. data/ext/couchbase/core/impl/subdoc/lookup_in_macro.cxx +117 -0
  136. data/ext/couchbase/core/impl/subdoc/lookup_in_specs.cxx +42 -0
  137. data/ext/couchbase/core/impl/subdoc/mutate_in_macro.cxx +77 -0
  138. data/ext/couchbase/core/impl/subdoc/mutate_in_specs.cxx +42 -0
  139. data/ext/couchbase/core/impl/subdoc/opcode.hxx +47 -0
  140. data/ext/couchbase/core/impl/subdoc/path_flags.hxx +77 -0
  141. data/ext/couchbase/core/impl/subdoc/remove.cxx +36 -0
  142. data/ext/couchbase/core/impl/subdoc/replace.cxx +36 -0
  143. data/ext/couchbase/core/impl/subdoc/upsert.cxx +36 -0
  144. data/ext/couchbase/core/impl/touch.cxx +49 -0
  145. data/ext/couchbase/core/impl/transaction_error_category.cxx +54 -0
  146. data/ext/couchbase/core/impl/transaction_get_result.cxx +54 -0
  147. data/ext/couchbase/core/impl/transaction_op_error_category.cxx +90 -0
  148. data/ext/couchbase/core/impl/unlock.cxx +47 -0
  149. data/ext/couchbase/core/impl/upsert.cxx +100 -0
  150. data/ext/couchbase/core/impl/view_error_category.cxx +50 -0
  151. data/ext/couchbase/core/impl/watch_query_indexes.cxx +168 -0
  152. data/ext/couchbase/core/impl/with_legacy_durability.hxx +65 -0
  153. data/ext/couchbase/core/io/dns_client.hxx +224 -0
  154. data/ext/couchbase/core/io/dns_codec.hxx +207 -0
  155. data/ext/couchbase/core/io/dns_config.cxx +157 -0
  156. data/ext/couchbase/core/io/dns_config.hxx +68 -0
  157. data/ext/couchbase/core/io/dns_message.hxx +555 -0
  158. data/ext/couchbase/core/io/http_command.hxx +182 -0
  159. data/ext/couchbase/core/io/http_context.hxx +40 -0
  160. data/ext/couchbase/core/io/http_message.hxx +116 -0
  161. data/ext/couchbase/core/io/http_parser.cxx +141 -0
  162. data/ext/couchbase/core/io/http_parser.hxx +55 -0
  163. data/ext/couchbase/core/io/http_session.hxx +552 -0
  164. data/ext/couchbase/core/io/http_session_manager.hxx +388 -0
  165. data/ext/couchbase/core/io/http_traits.hxx +38 -0
  166. data/ext/couchbase/core/io/ip_protocol.hxx +28 -0
  167. data/ext/couchbase/core/io/mcbp_command.hxx +317 -0
  168. data/ext/couchbase/core/io/mcbp_context.hxx +40 -0
  169. data/ext/couchbase/core/io/mcbp_message.cxx +39 -0
  170. data/ext/couchbase/core/io/mcbp_message.hxx +60 -0
  171. data/ext/couchbase/core/io/mcbp_parser.cxx +88 -0
  172. data/ext/couchbase/core/io/mcbp_parser.hxx +45 -0
  173. data/ext/couchbase/core/io/mcbp_session.cxx +1690 -0
  174. data/ext/couchbase/core/io/mcbp_session.hxx +130 -0
  175. data/ext/couchbase/core/io/mcbp_traits.hxx +38 -0
  176. data/ext/couchbase/core/io/query_cache.hxx +71 -0
  177. data/ext/couchbase/core/io/retry_context.hxx +89 -0
  178. data/ext/couchbase/core/io/retry_orchestrator.hxx +97 -0
  179. data/ext/couchbase/core/io/streams.hxx +258 -0
  180. data/ext/couchbase/core/json_string.hxx +82 -0
  181. data/ext/couchbase/core/key_value_config.cxx +35 -0
  182. data/ext/couchbase/core/key_value_config.hxx +40 -0
  183. data/ext/couchbase/core/logger/CMakeLists.txt +9 -0
  184. data/ext/couchbase/core/logger/configuration.hxx +60 -0
  185. data/ext/couchbase/core/logger/custom_rotating_file_sink.cxx +157 -0
  186. data/ext/couchbase/core/logger/level.hxx +21 -0
  187. data/ext/couchbase/core/logger/logger.cxx +340 -0
  188. data/ext/couchbase/core/logger/logger.hxx +240 -0
  189. data/ext/couchbase/core/management/analytics_dataset.hxx +30 -0
  190. data/ext/couchbase/core/management/analytics_index.hxx +30 -0
  191. data/ext/couchbase/core/management/analytics_link.hxx +22 -0
  192. data/ext/couchbase/core/management/analytics_link_azure_blob_external.cxx +68 -0
  193. data/ext/couchbase/core/management/analytics_link_azure_blob_external.hxx +76 -0
  194. data/ext/couchbase/core/management/analytics_link_azure_blob_external_json.hxx +52 -0
  195. data/ext/couchbase/core/management/analytics_link_couchbase_remote.cxx +105 -0
  196. data/ext/couchbase/core/management/analytics_link_couchbase_remote.hxx +107 -0
  197. data/ext/couchbase/core/management/analytics_link_couchbase_remote_json.hxx +63 -0
  198. data/ext/couchbase/core/management/analytics_link_s3_external.cxx +58 -0
  199. data/ext/couchbase/core/management/analytics_link_s3_external.hxx +69 -0
  200. data/ext/couchbase/core/management/analytics_link_s3_external_json.hxx +47 -0
  201. data/ext/couchbase/core/management/bucket_settings.hxx +134 -0
  202. data/ext/couchbase/core/management/bucket_settings_json.hxx +123 -0
  203. data/ext/couchbase/core/management/design_document.hxx +41 -0
  204. data/ext/couchbase/core/management/eventing_function.hxx +188 -0
  205. data/ext/couchbase/core/management/eventing_function_json.hxx +212 -0
  206. data/ext/couchbase/core/management/eventing_status.hxx +84 -0
  207. data/ext/couchbase/core/management/eventing_status_json.hxx +77 -0
  208. data/ext/couchbase/core/management/rbac.hxx +77 -0
  209. data/ext/couchbase/core/management/rbac_fmt.hxx +49 -0
  210. data/ext/couchbase/core/management/rbac_json.hxx +179 -0
  211. data/ext/couchbase/core/management/search_index.hxx +38 -0
  212. data/ext/couchbase/core/management/search_index_json.hxx +58 -0
  213. data/ext/couchbase/core/mcbp/barrier_frame.hxx +27 -0
  214. data/ext/couchbase/core/mcbp/big_endian.cxx +73 -0
  215. data/ext/couchbase/core/mcbp/big_endian.hxx +46 -0
  216. data/ext/couchbase/core/mcbp/buffer_writer.cxx +78 -0
  217. data/ext/couchbase/core/mcbp/buffer_writer.hxx +38 -0
  218. data/ext/couchbase/core/mcbp/codec.cxx +501 -0
  219. data/ext/couchbase/core/mcbp/codec.hxx +52 -0
  220. data/ext/couchbase/core/mcbp/command_code.cxx +77 -0
  221. data/ext/couchbase/core/mcbp/command_code.hxx +33 -0
  222. data/ext/couchbase/core/mcbp/completion_token.hxx +69 -0
  223. data/ext/couchbase/core/mcbp/datatype.hxx +40 -0
  224. data/ext/couchbase/core/mcbp/durability_level.hxx +35 -0
  225. data/ext/couchbase/core/mcbp/durability_level_frame.hxx +28 -0
  226. data/ext/couchbase/core/mcbp/durability_timeout_frame.hxx +29 -0
  227. data/ext/couchbase/core/mcbp/frame_type.hxx +41 -0
  228. data/ext/couchbase/core/mcbp/open_tracing_frame.hxx +29 -0
  229. data/ext/couchbase/core/mcbp/operation_consumer.cxx +47 -0
  230. data/ext/couchbase/core/mcbp/operation_consumer.hxx +42 -0
  231. data/ext/couchbase/core/mcbp/operation_queue.cxx +158 -0
  232. data/ext/couchbase/core/mcbp/operation_queue.hxx +57 -0
  233. data/ext/couchbase/core/mcbp/packet.cxx +92 -0
  234. data/ext/couchbase/core/mcbp/packet.hxx +71 -0
  235. data/ext/couchbase/core/mcbp/preserve_expiry_frame.hxx +26 -0
  236. data/ext/couchbase/core/mcbp/queue_callback.hxx +34 -0
  237. data/ext/couchbase/core/mcbp/queue_request.cxx +174 -0
  238. data/ext/couchbase/core/mcbp/queue_request.hxx +120 -0
  239. data/ext/couchbase/core/mcbp/queue_request_connection_info.hxx +29 -0
  240. data/ext/couchbase/core/mcbp/queue_response.hxx +37 -0
  241. data/ext/couchbase/core/mcbp/read_units_frame.hxx +28 -0
  242. data/ext/couchbase/core/mcbp/server_duration.cxx +40 -0
  243. data/ext/couchbase/core/mcbp/server_duration.hxx +32 -0
  244. data/ext/couchbase/core/mcbp/server_duration_frame.hxx +28 -0
  245. data/ext/couchbase/core/mcbp/stream_id_frame.hxx +28 -0
  246. data/ext/couchbase/core/mcbp/unsupported_frame.hxx +32 -0
  247. data/ext/couchbase/core/mcbp/user_impersonation_frame.hxx +30 -0
  248. data/ext/couchbase/core/mcbp/write_units_frame.hxx +29 -0
  249. data/ext/couchbase/core/meta/CMakeLists.txt +19 -0
  250. data/ext/couchbase/core/meta/features.hxx +31 -0
  251. data/ext/couchbase/core/meta/version.cxx +283 -0
  252. data/ext/couchbase/core/meta/version.hxx +56 -0
  253. data/ext/couchbase/core/metrics/CMakeLists.txt +13 -0
  254. data/ext/couchbase/core/metrics/logging_meter.cxx +235 -0
  255. data/ext/couchbase/core/metrics/logging_meter.hxx +60 -0
  256. data/ext/couchbase/core/metrics/logging_meter_options.hxx +28 -0
  257. data/ext/couchbase/core/metrics/noop_meter.hxx +47 -0
  258. data/ext/couchbase/core/n1ql_query_options.cxx +94 -0
  259. data/ext/couchbase/core/n1ql_query_options.hxx +78 -0
  260. data/ext/couchbase/core/operation_map.hxx +36 -0
  261. data/ext/couchbase/core/operations/document_analytics.cxx +221 -0
  262. data/ext/couchbase/core/operations/document_analytics.hxx +113 -0
  263. data/ext/couchbase/core/operations/document_append.cxx +45 -0
  264. data/ext/couchbase/core/operations/document_append.hxx +78 -0
  265. data/ext/couchbase/core/operations/document_decrement.cxx +53 -0
  266. data/ext/couchbase/core/operations/document_decrement.hxx +81 -0
  267. data/ext/couchbase/core/operations/document_exists.cxx +50 -0
  268. data/ext/couchbase/core/operations/document_exists.hxx +72 -0
  269. data/ext/couchbase/core/operations/document_get.cxx +44 -0
  270. data/ext/couchbase/core/operations/document_get.hxx +62 -0
  271. data/ext/couchbase/core/operations/document_get_all_replicas.hxx +143 -0
  272. data/ext/couchbase/core/operations/document_get_and_lock.cxx +45 -0
  273. data/ext/couchbase/core/operations/document_get_and_lock.hxx +64 -0
  274. data/ext/couchbase/core/operations/document_get_and_touch.cxx +45 -0
  275. data/ext/couchbase/core/operations/document_get_and_touch.hxx +65 -0
  276. data/ext/couchbase/core/operations/document_get_any_replica.hxx +133 -0
  277. data/ext/couchbase/core/operations/document_get_projected.cxx +238 -0
  278. data/ext/couchbase/core/operations/document_get_projected.hxx +68 -0
  279. data/ext/couchbase/core/operations/document_increment.cxx +53 -0
  280. data/ext/couchbase/core/operations/document_increment.hxx +81 -0
  281. data/ext/couchbase/core/operations/document_insert.cxx +51 -0
  282. data/ext/couchbase/core/operations/document_insert.hxx +80 -0
  283. data/ext/couchbase/core/operations/document_lookup_in.cxx +97 -0
  284. data/ext/couchbase/core/operations/document_lookup_in.hxx +77 -0
  285. data/ext/couchbase/core/operations/document_mutate_in.cxx +118 -0
  286. data/ext/couchbase/core/operations/document_mutate_in.hxx +95 -0
  287. data/ext/couchbase/core/operations/document_prepend.cxx +45 -0
  288. data/ext/couchbase/core/operations/document_prepend.hxx +78 -0
  289. data/ext/couchbase/core/operations/document_query.cxx +386 -0
  290. data/ext/couchbase/core/operations/document_query.hxx +128 -0
  291. data/ext/couchbase/core/operations/document_remove.cxx +45 -0
  292. data/ext/couchbase/core/operations/document_remove.hxx +78 -0
  293. data/ext/couchbase/core/operations/document_replace.cxx +55 -0
  294. data/ext/couchbase/core/operations/document_replace.hxx +82 -0
  295. data/ext/couchbase/core/operations/document_search.cxx +315 -0
  296. data/ext/couchbase/core/operations/document_search.hxx +162 -0
  297. data/ext/couchbase/core/operations/document_touch.cxx +43 -0
  298. data/ext/couchbase/core/operations/document_touch.hxx +61 -0
  299. data/ext/couchbase/core/operations/document_unlock.cxx +43 -0
  300. data/ext/couchbase/core/operations/document_unlock.hxx +61 -0
  301. data/ext/couchbase/core/operations/document_upsert.cxx +54 -0
  302. data/ext/couchbase/core/operations/document_upsert.hxx +81 -0
  303. data/ext/couchbase/core/operations/document_view.cxx +197 -0
  304. data/ext/couchbase/core/operations/document_view.hxx +109 -0
  305. data/ext/couchbase/core/operations/http_noop.cxx +64 -0
  306. data/ext/couchbase/core/operations/http_noop.hxx +48 -0
  307. data/ext/couchbase/core/operations/management/CMakeLists.txt +80 -0
  308. data/ext/couchbase/core/operations/management/analytics.hxx +34 -0
  309. data/ext/couchbase/core/operations/management/analytics_dataset_create.cxx +93 -0
  310. data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +57 -0
  311. data/ext/couchbase/core/operations/management/analytics_dataset_drop.cxx +82 -0
  312. data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +54 -0
  313. data/ext/couchbase/core/operations/management/analytics_dataset_get_all.cxx +78 -0
  314. data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +52 -0
  315. data/ext/couchbase/core/operations/management/analytics_dataverse_create.cxx +81 -0
  316. data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +53 -0
  317. data/ext/couchbase/core/operations/management/analytics_dataverse_drop.cxx +81 -0
  318. data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +53 -0
  319. data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.cxx +69 -0
  320. data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +52 -0
  321. data/ext/couchbase/core/operations/management/analytics_index_create.cxx +105 -0
  322. data/ext/couchbase/core/operations/management/analytics_index_create.hxx +56 -0
  323. data/ext/couchbase/core/operations/management/analytics_index_drop.cxx +89 -0
  324. data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +55 -0
  325. data/ext/couchbase/core/operations/management/analytics_index_get_all.cxx +79 -0
  326. data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +52 -0
  327. data/ext/couchbase/core/operations/management/analytics_link_connect.cxx +81 -0
  328. data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +57 -0
  329. data/ext/couchbase/core/operations/management/analytics_link_create.cxx +86 -0
  330. data/ext/couchbase/core/operations/management/analytics_link_create.hxx +77 -0
  331. data/ext/couchbase/core/operations/management/analytics_link_disconnect.cxx +79 -0
  332. data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +56 -0
  333. data/ext/couchbase/core/operations/management/analytics_link_drop.cxx +102 -0
  334. data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +56 -0
  335. data/ext/couchbase/core/operations/management/analytics_link_get_all.cxx +128 -0
  336. data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +63 -0
  337. data/ext/couchbase/core/operations/management/analytics_link_replace.cxx +86 -0
  338. data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +78 -0
  339. data/ext/couchbase/core/operations/management/analytics_link_utils.hxx +37 -0
  340. data/ext/couchbase/core/operations/management/analytics_problem.hxx +31 -0
  341. data/ext/couchbase/core/operations/management/bucket.hxx +25 -0
  342. data/ext/couchbase/core/operations/management/bucket_create.cxx +171 -0
  343. data/ext/couchbase/core/operations/management/bucket_create.hxx +52 -0
  344. data/ext/couchbase/core/operations/management/bucket_describe.cxx +98 -0
  345. data/ext/couchbase/core/operations/management/bucket_describe.hxx +64 -0
  346. data/ext/couchbase/core/operations/management/bucket_drop.cxx +51 -0
  347. data/ext/couchbase/core/operations/management/bucket_drop.hxx +49 -0
  348. data/ext/couchbase/core/operations/management/bucket_flush.cxx +58 -0
  349. data/ext/couchbase/core/operations/management/bucket_flush.hxx +49 -0
  350. data/ext/couchbase/core/operations/management/bucket_get.cxx +58 -0
  351. data/ext/couchbase/core/operations/management/bucket_get.hxx +51 -0
  352. data/ext/couchbase/core/operations/management/bucket_get_all.cxx +58 -0
  353. data/ext/couchbase/core/operations/management/bucket_get_all.hxx +49 -0
  354. data/ext/couchbase/core/operations/management/bucket_update.cxx +130 -0
  355. data/ext/couchbase/core/operations/management/bucket_update.hxx +52 -0
  356. data/ext/couchbase/core/operations/management/change_password.cxx +55 -0
  357. data/ext/couchbase/core/operations/management/change_password.hxx +50 -0
  358. data/ext/couchbase/core/operations/management/cluster_describe.cxx +89 -0
  359. data/ext/couchbase/core/operations/management/cluster_describe.hxx +72 -0
  360. data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.cxx +43 -0
  361. data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +48 -0
  362. data/ext/couchbase/core/operations/management/collection_create.cxx +82 -0
  363. data/ext/couchbase/core/operations/management/collection_create.hxx +53 -0
  364. data/ext/couchbase/core/operations/management/collection_drop.cxx +72 -0
  365. data/ext/couchbase/core/operations/management/collection_drop.hxx +52 -0
  366. data/ext/couchbase/core/operations/management/collections.hxx +25 -0
  367. data/ext/couchbase/core/operations/management/collections_manifest_get.cxx +40 -0
  368. data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +53 -0
  369. data/ext/couchbase/core/operations/management/error_utils.cxx +267 -0
  370. data/ext/couchbase/core/operations/management/error_utils.hxx +49 -0
  371. data/ext/couchbase/core/operations/management/eventing.hxx +28 -0
  372. data/ext/couchbase/core/operations/management/eventing_deploy_function.cxx +55 -0
  373. data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +52 -0
  374. data/ext/couchbase/core/operations/management/eventing_drop_function.cxx +56 -0
  375. data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +52 -0
  376. data/ext/couchbase/core/operations/management/eventing_get_all_functions.cxx +63 -0
  377. data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +51 -0
  378. data/ext/couchbase/core/operations/management/eventing_get_function.cxx +55 -0
  379. data/ext/couchbase/core/operations/management/eventing_get_function.hxx +53 -0
  380. data/ext/couchbase/core/operations/management/eventing_get_status.cxx +55 -0
  381. data/ext/couchbase/core/operations/management/eventing_get_status.hxx +53 -0
  382. data/ext/couchbase/core/operations/management/eventing_pause_function.cxx +55 -0
  383. data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +52 -0
  384. data/ext/couchbase/core/operations/management/eventing_problem.hxx +32 -0
  385. data/ext/couchbase/core/operations/management/eventing_resume_function.cxx +55 -0
  386. data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +52 -0
  387. data/ext/couchbase/core/operations/management/eventing_undeploy_function.cxx +55 -0
  388. data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +52 -0
  389. data/ext/couchbase/core/operations/management/eventing_upsert_function.cxx +340 -0
  390. data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +52 -0
  391. data/ext/couchbase/core/operations/management/freeform.cxx +54 -0
  392. data/ext/couchbase/core/operations/management/freeform.hxx +55 -0
  393. data/ext/couchbase/core/operations/management/group_drop.cxx +50 -0
  394. data/ext/couchbase/core/operations/management/group_drop.hxx +49 -0
  395. data/ext/couchbase/core/operations/management/group_get.cxx +59 -0
  396. data/ext/couchbase/core/operations/management/group_get.hxx +50 -0
  397. data/ext/couchbase/core/operations/management/group_get_all.cxx +57 -0
  398. data/ext/couchbase/core/operations/management/group_get_all.hxx +49 -0
  399. data/ext/couchbase/core/operations/management/group_upsert.cxx +95 -0
  400. data/ext/couchbase/core/operations/management/group_upsert.hxx +51 -0
  401. data/ext/couchbase/core/operations/management/query.hxx +25 -0
  402. data/ext/couchbase/core/operations/management/query_index_build.cxx +92 -0
  403. data/ext/couchbase/core/operations/management/query_index_build.hxx +62 -0
  404. data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +116 -0
  405. data/ext/couchbase/core/operations/management/query_index_create.cxx +146 -0
  406. data/ext/couchbase/core/operations/management/query_index_create.hxx +67 -0
  407. data/ext/couchbase/core/operations/management/query_index_drop.cxx +127 -0
  408. data/ext/couchbase/core/operations/management/query_index_drop.hxx +63 -0
  409. data/ext/couchbase/core/operations/management/query_index_get_all.cxx +129 -0
  410. data/ext/couchbase/core/operations/management/query_index_get_all.hxx +56 -0
  411. data/ext/couchbase/core/operations/management/query_index_get_all_deferred.cxx +96 -0
  412. data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +57 -0
  413. data/ext/couchbase/core/operations/management/role_get_all.cxx +57 -0
  414. data/ext/couchbase/core/operations/management/role_get_all.hxx +49 -0
  415. data/ext/couchbase/core/operations/management/scope_create.cxx +74 -0
  416. data/ext/couchbase/core/operations/management/scope_create.hxx +51 -0
  417. data/ext/couchbase/core/operations/management/scope_drop.cxx +69 -0
  418. data/ext/couchbase/core/operations/management/scope_drop.hxx +51 -0
  419. data/ext/couchbase/core/operations/management/scope_get_all.cxx +61 -0
  420. data/ext/couchbase/core/operations/management/scope_get_all.hxx +51 -0
  421. data/ext/couchbase/core/operations/management/search.hxx +30 -0
  422. data/ext/couchbase/core/operations/management/search_get_stats.cxx +41 -0
  423. data/ext/couchbase/core/operations/management/search_get_stats.hxx +48 -0
  424. data/ext/couchbase/core/operations/management/search_index_analyze_document.cxx +84 -0
  425. data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +54 -0
  426. data/ext/couchbase/core/operations/management/search_index_control_ingest.cxx +72 -0
  427. data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +52 -0
  428. data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.cxx +72 -0
  429. data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +57 -0
  430. data/ext/couchbase/core/operations/management/search_index_control_query.cxx +72 -0
  431. data/ext/couchbase/core/operations/management/search_index_control_query.hxx +52 -0
  432. data/ext/couchbase/core/operations/management/search_index_drop.cxx +71 -0
  433. data/ext/couchbase/core/operations/management/search_index_drop.hxx +51 -0
  434. data/ext/couchbase/core/operations/management/search_index_get.cxx +74 -0
  435. data/ext/couchbase/core/operations/management/search_index_get.hxx +54 -0
  436. data/ext/couchbase/core/operations/management/search_index_get_all.cxx +66 -0
  437. data/ext/couchbase/core/operations/management/search_index_get_all.hxx +51 -0
  438. data/ext/couchbase/core/operations/management/search_index_get_documents_count.cxx +78 -0
  439. data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +53 -0
  440. data/ext/couchbase/core/operations/management/search_index_get_stats.cxx +70 -0
  441. data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +52 -0
  442. data/ext/couchbase/core/operations/management/search_index_upsert.cxx +114 -0
  443. data/ext/couchbase/core/operations/management/search_index_upsert.hxx +54 -0
  444. data/ext/couchbase/core/operations/management/user.hxx +29 -0
  445. data/ext/couchbase/core/operations/management/user_drop.cxx +51 -0
  446. data/ext/couchbase/core/operations/management/user_drop.hxx +51 -0
  447. data/ext/couchbase/core/operations/management/user_get.cxx +60 -0
  448. data/ext/couchbase/core/operations/management/user_get.hxx +52 -0
  449. data/ext/couchbase/core/operations/management/user_get_all.cxx +58 -0
  450. data/ext/couchbase/core/operations/management/user_get_all.hxx +51 -0
  451. data/ext/couchbase/core/operations/management/user_upsert.cxx +100 -0
  452. data/ext/couchbase/core/operations/management/user_upsert.hxx +52 -0
  453. data/ext/couchbase/core/operations/management/view.hxx +23 -0
  454. data/ext/couchbase/core/operations/management/view_index_drop.cxx +45 -0
  455. data/ext/couchbase/core/operations/management/view_index_drop.hxx +52 -0
  456. data/ext/couchbase/core/operations/management/view_index_get.cxx +73 -0
  457. data/ext/couchbase/core/operations/management/view_index_get.hxx +53 -0
  458. data/ext/couchbase/core/operations/management/view_index_get_all.cxx +107 -0
  459. data/ext/couchbase/core/operations/management/view_index_get_all.hxx +52 -0
  460. data/ext/couchbase/core/operations/management/view_index_upsert.cxx +70 -0
  461. data/ext/couchbase/core/operations/management/view_index_upsert.hxx +51 -0
  462. data/ext/couchbase/core/operations/mcbp_noop.cxx +38 -0
  463. data/ext/couchbase/core/operations/mcbp_noop.hxx +49 -0
  464. data/ext/couchbase/core/operations/operation_traits.hxx +31 -0
  465. data/ext/couchbase/core/operations.hxx +44 -0
  466. data/ext/couchbase/core/origin.hxx +195 -0
  467. data/ext/couchbase/core/pending_operation.hxx +26 -0
  468. data/ext/couchbase/core/ping_collector.hxx +32 -0
  469. data/ext/couchbase/core/ping_options.hxx +86 -0
  470. data/ext/couchbase/core/ping_reporter.hxx +30 -0
  471. data/ext/couchbase/core/platform/CMakeLists.txt +16 -0
  472. data/ext/couchbase/core/platform/backtrace.c +189 -0
  473. data/ext/couchbase/core/platform/base64.cc +253 -0
  474. data/ext/couchbase/core/platform/base64.h +52 -0
  475. data/ext/couchbase/core/platform/dirutils.cc +123 -0
  476. data/ext/couchbase/core/platform/dirutils.h +43 -0
  477. data/ext/couchbase/core/platform/random.cc +120 -0
  478. data/ext/couchbase/core/platform/random.h +39 -0
  479. data/ext/couchbase/core/platform/string_hex.cc +101 -0
  480. data/ext/couchbase/core/platform/string_hex.h +50 -0
  481. data/ext/couchbase/core/platform/terminate_handler.cc +125 -0
  482. data/ext/couchbase/core/platform/terminate_handler.h +36 -0
  483. data/ext/couchbase/core/platform/uuid.cc +102 -0
  484. data/ext/couchbase/core/platform/uuid.h +56 -0
  485. data/ext/couchbase/core/protocol/client_opcode.hxx +369 -0
  486. data/ext/couchbase/core/protocol/client_opcode_fmt.hxx +325 -0
  487. data/ext/couchbase/core/protocol/client_request.cxx +38 -0
  488. data/ext/couchbase/core/protocol/client_request.hxx +167 -0
  489. data/ext/couchbase/core/protocol/client_response.cxx +75 -0
  490. data/ext/couchbase/core/protocol/client_response.hxx +210 -0
  491. data/ext/couchbase/core/protocol/cmd_append.cxx +74 -0
  492. data/ext/couchbase/core/protocol/cmd_append.hxx +107 -0
  493. data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.cxx +53 -0
  494. data/ext/couchbase/core/protocol/cmd_cluster_map_change_notification.hxx +57 -0
  495. data/ext/couchbase/core/protocol/cmd_decrement.cxx +96 -0
  496. data/ext/couchbase/core/protocol/cmd_decrement.hxx +130 -0
  497. data/ext/couchbase/core/protocol/cmd_get.cxx +59 -0
  498. data/ext/couchbase/core/protocol/cmd_get.hxx +96 -0
  499. data/ext/couchbase/core/protocol/cmd_get_and_lock.cxx +66 -0
  500. data/ext/couchbase/core/protocol/cmd_get_and_lock.hxx +112 -0
  501. data/ext/couchbase/core/protocol/cmd_get_and_touch.cxx +66 -0
  502. data/ext/couchbase/core/protocol/cmd_get_and_touch.hxx +112 -0
  503. data/ext/couchbase/core/protocol/cmd_get_cluster_config.cxx +85 -0
  504. data/ext/couchbase/core/protocol/cmd_get_cluster_config.hxx +89 -0
  505. data/ext/couchbase/core/protocol/cmd_get_collection_id.cxx +60 -0
  506. data/ext/couchbase/core/protocol/cmd_get_collection_id.hxx +95 -0
  507. data/ext/couchbase/core/protocol/cmd_get_collections_manifest.cxx +51 -0
  508. data/ext/couchbase/core/protocol/cmd_get_collections_manifest.hxx +84 -0
  509. data/ext/couchbase/core/protocol/cmd_get_error_map.cxx +61 -0
  510. data/ext/couchbase/core/protocol/cmd_get_error_map.hxx +103 -0
  511. data/ext/couchbase/core/protocol/cmd_get_meta.cxx +70 -0
  512. data/ext/couchbase/core/protocol/cmd_get_meta.hxx +117 -0
  513. data/ext/couchbase/core/protocol/cmd_get_replica.cxx +71 -0
  514. data/ext/couchbase/core/protocol/cmd_get_replica.hxx +88 -0
  515. data/ext/couchbase/core/protocol/cmd_hello.cxx +76 -0
  516. data/ext/couchbase/core/protocol/cmd_hello.hxx +140 -0
  517. data/ext/couchbase/core/protocol/cmd_increment.cxx +98 -0
  518. data/ext/couchbase/core/protocol/cmd_increment.hxx +130 -0
  519. data/ext/couchbase/core/protocol/cmd_info.hxx +30 -0
  520. data/ext/couchbase/core/protocol/cmd_insert.cxx +83 -0
  521. data/ext/couchbase/core/protocol/cmd_insert.hxx +124 -0
  522. data/ext/couchbase/core/protocol/cmd_lookup_in.cxx +108 -0
  523. data/ext/couchbase/core/protocol/cmd_lookup_in.hxx +139 -0
  524. data/ext/couchbase/core/protocol/cmd_mutate_in.cxx +163 -0
  525. data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +216 -0
  526. data/ext/couchbase/core/protocol/cmd_noop.cxx +36 -0
  527. data/ext/couchbase/core/protocol/cmd_noop.hxx +75 -0
  528. data/ext/couchbase/core/protocol/cmd_observe_seqno.cxx +92 -0
  529. data/ext/couchbase/core/protocol/cmd_observe_seqno.hxx +132 -0
  530. data/ext/couchbase/core/protocol/cmd_prepend.cxx +73 -0
  531. data/ext/couchbase/core/protocol/cmd_prepend.hxx +103 -0
  532. data/ext/couchbase/core/protocol/cmd_remove.cxx +74 -0
  533. data/ext/couchbase/core/protocol/cmd_remove.hxx +94 -0
  534. data/ext/couchbase/core/protocol/cmd_replace.cxx +92 -0
  535. data/ext/couchbase/core/protocol/cmd_replace.hxx +131 -0
  536. data/ext/couchbase/core/protocol/cmd_sasl_auth.cxx +61 -0
  537. data/ext/couchbase/core/protocol/cmd_sasl_auth.hxx +91 -0
  538. data/ext/couchbase/core/protocol/cmd_sasl_list_mechs.cxx +53 -0
  539. data/ext/couchbase/core/protocol/cmd_sasl_list_mechs.hxx +82 -0
  540. data/ext/couchbase/core/protocol/cmd_sasl_step.cxx +61 -0
  541. data/ext/couchbase/core/protocol/cmd_sasl_step.hxx +91 -0
  542. data/ext/couchbase/core/protocol/cmd_select_bucket.cxx +45 -0
  543. data/ext/couchbase/core/protocol/cmd_select_bucket.hxx +79 -0
  544. data/ext/couchbase/core/protocol/cmd_touch.cxx +53 -0
  545. data/ext/couchbase/core/protocol/cmd_touch.hxx +84 -0
  546. data/ext/couchbase/core/protocol/cmd_unlock.cxx +44 -0
  547. data/ext/couchbase/core/protocol/cmd_unlock.hxx +81 -0
  548. data/ext/couchbase/core/protocol/cmd_upsert.cxx +92 -0
  549. data/ext/couchbase/core/protocol/cmd_upsert.hxx +126 -0
  550. data/ext/couchbase/core/protocol/datatype.hxx +48 -0
  551. data/ext/couchbase/core/protocol/enhanced_error_info.hxx +23 -0
  552. data/ext/couchbase/core/protocol/frame_info_id.hxx +142 -0
  553. data/ext/couchbase/core/protocol/frame_info_id_fmt.hxx +79 -0
  554. data/ext/couchbase/core/protocol/frame_info_utils.cxx +59 -0
  555. data/ext/couchbase/core/protocol/frame_info_utils.hxx +52 -0
  556. data/ext/couchbase/core/protocol/hello_feature.hxx +193 -0
  557. data/ext/couchbase/core/protocol/hello_feature_fmt.hxx +112 -0
  558. data/ext/couchbase/core/protocol/magic.hxx +53 -0
  559. data/ext/couchbase/core/protocol/magic_fmt.hxx +58 -0
  560. data/ext/couchbase/core/protocol/server_opcode.hxx +39 -0
  561. data/ext/couchbase/core/protocol/server_opcode_fmt.hxx +46 -0
  562. data/ext/couchbase/core/protocol/server_request.hxx +121 -0
  563. data/ext/couchbase/core/protocol/status.cxx +202 -0
  564. data/ext/couchbase/core/protocol/status.hxx +118 -0
  565. data/ext/couchbase/core/query_context.hxx +79 -0
  566. data/ext/couchbase/core/range_scan_options.cxx +57 -0
  567. data/ext/couchbase/core/range_scan_options.hxx +139 -0
  568. data/ext/couchbase/core/range_scan_orchestrator.cxx +495 -0
  569. data/ext/couchbase/core/range_scan_orchestrator.hxx +54 -0
  570. data/ext/couchbase/core/range_scan_orchestrator_options.hxx +54 -0
  571. data/ext/couchbase/core/resource_units.hxx +26 -0
  572. data/ext/couchbase/core/response_handler.hxx +49 -0
  573. data/ext/couchbase/core/retry_orchestrator.cxx +52 -0
  574. data/ext/couchbase/core/retry_orchestrator.hxx +35 -0
  575. data/ext/couchbase/core/sasl/CMakeLists.txt +16 -0
  576. data/ext/couchbase/core/sasl/client.cc +50 -0
  577. data/ext/couchbase/core/sasl/client.h +127 -0
  578. data/ext/couchbase/core/sasl/context.cc +34 -0
  579. data/ext/couchbase/core/sasl/context.h +52 -0
  580. data/ext/couchbase/core/sasl/error.h +28 -0
  581. data/ext/couchbase/core/sasl/error_fmt.h +70 -0
  582. data/ext/couchbase/core/sasl/mechanism.cc +45 -0
  583. data/ext/couchbase/core/sasl/mechanism.h +52 -0
  584. data/ext/couchbase/core/sasl/plain/plain.cc +39 -0
  585. data/ext/couchbase/core/sasl/plain/plain.h +54 -0
  586. data/ext/couchbase/core/sasl/scram-sha/scram-sha.cc +372 -0
  587. data/ext/couchbase/core/sasl/scram-sha/scram-sha.h +184 -0
  588. data/ext/couchbase/core/sasl/scram-sha/stringutils.cc +82 -0
  589. data/ext/couchbase/core/sasl/scram-sha/stringutils.h +48 -0
  590. data/ext/couchbase/core/scan_options.hxx +63 -0
  591. data/ext/couchbase/core/scan_result.cxx +71 -0
  592. data/ext/couchbase/core/scan_result.hxx +59 -0
  593. data/ext/couchbase/core/search_highlight_style.hxx +23 -0
  594. data/ext/couchbase/core/search_query_options.cxx +72 -0
  595. data/ext/couchbase/core/search_query_options.hxx +74 -0
  596. data/ext/couchbase/core/search_scan_consistency.hxx +23 -0
  597. data/ext/couchbase/core/seed_config.cxx +39 -0
  598. data/ext/couchbase/core/seed_config.hxx +39 -0
  599. data/ext/couchbase/core/service_type.hxx +31 -0
  600. data/ext/couchbase/core/service_type_fmt.hxx +61 -0
  601. data/ext/couchbase/core/stats_options.hxx +61 -0
  602. data/ext/couchbase/core/subdoc_options.hxx +124 -0
  603. data/ext/couchbase/core/timeout_defaults.hxx +45 -0
  604. data/ext/couchbase/core/topology/capabilities.hxx +43 -0
  605. data/ext/couchbase/core/topology/capabilities_fmt.hxx +106 -0
  606. data/ext/couchbase/core/topology/collections_manifest.hxx +43 -0
  607. data/ext/couchbase/core/topology/collections_manifest_fmt.hxx +52 -0
  608. data/ext/couchbase/core/topology/collections_manifest_json.hxx +53 -0
  609. data/ext/couchbase/core/topology/configuration.cxx +256 -0
  610. data/ext/couchbase/core/topology/configuration.hxx +144 -0
  611. data/ext/couchbase/core/topology/configuration_fmt.hxx +166 -0
  612. data/ext/couchbase/core/topology/configuration_json.hxx +259 -0
  613. data/ext/couchbase/core/topology/error_map.hxx +35 -0
  614. data/ext/couchbase/core/topology/error_map_fmt.hxx +94 -0
  615. data/ext/couchbase/core/topology/error_map_json.hxx +89 -0
  616. data/ext/couchbase/core/tracing/CMakeLists.txt +11 -0
  617. data/ext/couchbase/core/tracing/constants.hxx +286 -0
  618. data/ext/couchbase/core/tracing/noop_tracer.hxx +56 -0
  619. data/ext/couchbase/core/tracing/threshold_logging_options.hxx +68 -0
  620. data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +438 -0
  621. data/ext/couchbase/core/tracing/threshold_logging_tracer.hxx +52 -0
  622. data/ext/couchbase/core/transactions/active_transaction_record.hxx +180 -0
  623. data/ext/couchbase/core/transactions/async_attempt_context.hxx +175 -0
  624. data/ext/couchbase/core/transactions/atr_cleanup_entry.cxx +461 -0
  625. data/ext/couchbase/core/transactions/atr_ids.cxx +225 -0
  626. data/ext/couchbase/core/transactions/atr_ids.hxx +32 -0
  627. data/ext/couchbase/core/transactions/attempt_context.hxx +195 -0
  628. data/ext/couchbase/core/transactions/attempt_context_impl.cxx +2413 -0
  629. data/ext/couchbase/core/transactions/attempt_context_impl.hxx +629 -0
  630. data/ext/couchbase/core/transactions/attempt_context_testing_hooks.hxx +145 -0
  631. data/ext/couchbase/core/transactions/attempt_state.hxx +112 -0
  632. data/ext/couchbase/core/transactions/binary.cxx +26 -0
  633. data/ext/couchbase/core/transactions/cleanup_testing_hooks.hxx +69 -0
  634. data/ext/couchbase/core/transactions/document_metadata.hxx +106 -0
  635. data/ext/couchbase/core/transactions/durability_level.hxx +91 -0
  636. data/ext/couchbase/core/transactions/error_class.hxx +35 -0
  637. data/ext/couchbase/core/transactions/error_list.hxx +54 -0
  638. data/ext/couchbase/core/transactions/exceptions.cxx +160 -0
  639. data/ext/couchbase/core/transactions/exceptions.hxx +209 -0
  640. data/ext/couchbase/core/transactions/forward_compat.hxx +250 -0
  641. data/ext/couchbase/core/transactions/internal/atr_cleanup_entry.hxx +164 -0
  642. data/ext/couchbase/core/transactions/internal/atr_entry.hxx +178 -0
  643. data/ext/couchbase/core/transactions/internal/binary.hxx +26 -0
  644. data/ext/couchbase/core/transactions/internal/client_record.hxx +85 -0
  645. data/ext/couchbase/core/transactions/internal/doc_record.hxx +99 -0
  646. data/ext/couchbase/core/transactions/internal/exceptions_internal.hxx +393 -0
  647. data/ext/couchbase/core/transactions/internal/logging.hxx +62 -0
  648. data/ext/couchbase/core/transactions/internal/transaction_attempt.hxx +30 -0
  649. data/ext/couchbase/core/transactions/internal/transaction_context.hxx +197 -0
  650. data/ext/couchbase/core/transactions/internal/transaction_fields.hxx +72 -0
  651. data/ext/couchbase/core/transactions/internal/transactions_cleanup.hxx +159 -0
  652. data/ext/couchbase/core/transactions/internal/utils.hxx +311 -0
  653. data/ext/couchbase/core/transactions/result.cxx +79 -0
  654. data/ext/couchbase/core/transactions/result.hxx +296 -0
  655. data/ext/couchbase/core/transactions/staged_mutation.cxx +416 -0
  656. data/ext/couchbase/core/transactions/staged_mutation.hxx +136 -0
  657. data/ext/couchbase/core/transactions/transaction_attempt.cxx +29 -0
  658. data/ext/couchbase/core/transactions/transaction_context.cxx +304 -0
  659. data/ext/couchbase/core/transactions/transaction_get_result.cxx +228 -0
  660. data/ext/couchbase/core/transactions/transaction_get_result.hxx +293 -0
  661. data/ext/couchbase/core/transactions/transaction_links.cxx +27 -0
  662. data/ext/couchbase/core/transactions/transaction_links.hxx +264 -0
  663. data/ext/couchbase/core/transactions/transaction_options.cxx +38 -0
  664. data/ext/couchbase/core/transactions/transactions.cxx +184 -0
  665. data/ext/couchbase/core/transactions/transactions_cleanup.cxx +592 -0
  666. data/ext/couchbase/core/transactions/transactions_config.cxx +81 -0
  667. data/ext/couchbase/core/transactions/uid_generator.cxx +27 -0
  668. data/ext/couchbase/core/transactions/uid_generator.hxx +29 -0
  669. data/ext/couchbase/core/transactions/utils.cxx +123 -0
  670. data/ext/couchbase/core/transactions/waitable_op_list.hxx +190 -0
  671. data/ext/couchbase/core/transactions.hxx +255 -0
  672. data/ext/couchbase/core/utils/binary.cxx +27 -0
  673. data/ext/couchbase/core/utils/binary.hxx +57 -0
  674. data/ext/couchbase/core/utils/byteswap.hxx +49 -0
  675. data/ext/couchbase/core/utils/connection_string.cxx +430 -0
  676. data/ext/couchbase/core/utils/connection_string.hxx +76 -0
  677. data/ext/couchbase/core/utils/crc32.hxx +56 -0
  678. data/ext/couchbase/core/utils/duration_parser.cxx +193 -0
  679. data/ext/couchbase/core/utils/duration_parser.hxx +45 -0
  680. data/ext/couchbase/core/utils/join_strings.hxx +65 -0
  681. data/ext/couchbase/core/utils/json.cxx +291 -0
  682. data/ext/couchbase/core/utils/json.hxx +43 -0
  683. data/ext/couchbase/core/utils/json_stream_control.hxx +32 -0
  684. data/ext/couchbase/core/utils/json_streaming_lexer.cxx +398 -0
  685. data/ext/couchbase/core/utils/json_streaming_lexer.hxx +60 -0
  686. data/ext/couchbase/core/utils/keyspace.hxx +55 -0
  687. data/ext/couchbase/core/utils/movable_function.hxx +121 -0
  688. data/ext/couchbase/core/utils/mutation_token.cxx +33 -0
  689. data/ext/couchbase/core/utils/mutation_token.hxx +29 -0
  690. data/ext/couchbase/core/utils/name_codec.hxx +41 -0
  691. data/ext/couchbase/core/utils/split_string.cxx +35 -0
  692. data/ext/couchbase/core/utils/split_string.hxx +27 -0
  693. data/ext/couchbase/core/utils/unsigned_leb128.hxx +183 -0
  694. data/ext/couchbase/core/utils/url_codec.cxx +405 -0
  695. data/ext/couchbase/core/utils/url_codec.hxx +72 -0
  696. data/ext/couchbase/core/view_on_error.hxx +27 -0
  697. data/ext/couchbase/core/view_query_options.cxx +72 -0
  698. data/ext/couchbase/core/view_query_options.hxx +78 -0
  699. data/ext/couchbase/core/view_scan_consistency.hxx +27 -0
  700. data/ext/couchbase/core/view_sort_order.hxx +23 -0
  701. data/ext/couchbase/core/wait_until_ready_options.hxx +52 -0
  702. data/ext/couchbase/couchbase/append_options.hxx +123 -0
  703. data/ext/couchbase/couchbase/behavior_options.hxx +79 -0
  704. data/ext/couchbase/couchbase/best_effort_retry_strategy.hxx +64 -0
  705. data/ext/couchbase/couchbase/binary_collection.hxx +327 -0
  706. data/ext/couchbase/couchbase/bucket.hxx +55 -494
  707. data/ext/couchbase/couchbase/build_query_index_options.hxx +99 -0
  708. data/ext/couchbase/couchbase/cas.hxx +74 -8
  709. data/ext/couchbase/couchbase/certificate_authenticator.hxx +39 -0
  710. data/ext/couchbase/couchbase/cluster.hxx +156 -370
  711. data/ext/couchbase/couchbase/cluster_options.hxx +315 -51
  712. data/ext/couchbase/couchbase/codec/binary_noop_serializer.hxx +47 -0
  713. data/ext/couchbase/couchbase/codec/codec_flags.hxx +145 -0
  714. data/ext/couchbase/couchbase/codec/default_json_transcoder.hxx +36 -0
  715. data/ext/couchbase/couchbase/codec/encoded_value.hxx +31 -0
  716. data/ext/couchbase/couchbase/codec/json_transcoder.hxx +49 -0
  717. data/ext/couchbase/couchbase/codec/raw_binary_transcoder.hxx +54 -0
  718. data/ext/couchbase/couchbase/codec/serializer_traits.hxx +31 -0
  719. data/ext/couchbase/couchbase/codec/tao_json_serializer.hxx +81 -0
  720. data/ext/couchbase/couchbase/codec/transcoder_traits.hxx +31 -0
  721. data/ext/couchbase/couchbase/collection.hxx +1036 -0
  722. data/ext/couchbase/couchbase/collection_query_index_manager.hxx +218 -0
  723. data/ext/couchbase/couchbase/common_durability_options.hxx +108 -0
  724. data/ext/couchbase/couchbase/common_options.hxx +112 -0
  725. data/ext/couchbase/couchbase/compression_options.hxx +65 -0
  726. data/ext/couchbase/couchbase/configuration_profile.hxx +44 -0
  727. data/ext/couchbase/couchbase/configuration_profiles_registry.hxx +60 -0
  728. data/ext/couchbase/couchbase/counter_result.hxx +73 -0
  729. data/ext/couchbase/couchbase/create_primary_query_index_options.hxx +166 -0
  730. data/ext/couchbase/couchbase/create_query_index_options.hxx +172 -0
  731. data/ext/couchbase/couchbase/decrement_options.hxx +166 -0
  732. data/ext/couchbase/couchbase/dns_options.hxx +65 -0
  733. data/ext/couchbase/couchbase/drop_primary_query_index_options.hxx +129 -0
  734. data/ext/couchbase/couchbase/drop_query_index_options.hxx +116 -0
  735. data/ext/couchbase/couchbase/durability_level.hxx +64 -0
  736. data/ext/couchbase/couchbase/error_codes.hxx +1223 -0
  737. data/ext/couchbase/couchbase/error_context.hxx +173 -0
  738. data/ext/couchbase/couchbase/exists_options.hxx +97 -0
  739. data/ext/couchbase/couchbase/exists_result.hxx +72 -0
  740. data/ext/couchbase/couchbase/expiry.hxx +55 -0
  741. data/ext/couchbase/couchbase/fail_fast_retry_strategy.hxx +37 -0
  742. data/ext/couchbase/couchbase/fmt/cas.hxx +49 -0
  743. data/ext/couchbase/couchbase/fmt/durability_level.hxx +58 -0
  744. data/ext/couchbase/couchbase/fmt/key_value_extended_error_info.hxx +52 -0
  745. data/ext/couchbase/couchbase/fmt/key_value_status_code.hxx +264 -0
  746. data/ext/couchbase/couchbase/fmt/mutation_token.hxx +44 -0
  747. data/ext/couchbase/couchbase/fmt/query_scan_consistency.hxx +52 -0
  748. data/ext/couchbase/couchbase/fmt/query_status.hxx +76 -0
  749. data/ext/couchbase/couchbase/fmt/retry_reason.hxx +109 -0
  750. data/ext/couchbase/couchbase/fmt/tls_verify_mode.hxx +52 -0
  751. data/ext/couchbase/couchbase/get_all_query_indexes_options.hxx +101 -0
  752. data/ext/couchbase/couchbase/get_all_replicas_options.hxx +102 -0
  753. data/ext/couchbase/couchbase/get_and_lock_options.hxx +94 -0
  754. data/ext/couchbase/couchbase/get_and_touch_options.hxx +94 -0
  755. data/ext/couchbase/couchbase/get_any_replica_options.hxx +93 -0
  756. data/ext/couchbase/couchbase/get_options.hxx +137 -0
  757. data/ext/couchbase/couchbase/get_replica_result.hxx +117 -0
  758. data/ext/couchbase/couchbase/get_result.hxx +126 -0
  759. data/ext/couchbase/couchbase/increment_options.hxx +166 -0
  760. data/ext/couchbase/couchbase/insert_options.hxx +136 -0
  761. data/ext/couchbase/couchbase/ip_protocol.hxx +27 -0
  762. data/ext/couchbase/couchbase/key_value_error_context.hxx +224 -0
  763. data/ext/couchbase/couchbase/key_value_error_map_attribute.hxx +124 -0
  764. data/ext/couchbase/couchbase/key_value_error_map_info.hxx +138 -0
  765. data/ext/couchbase/couchbase/key_value_extended_error_info.hxx +86 -0
  766. data/ext/couchbase/couchbase/key_value_status_code.hxx +107 -0
  767. data/ext/couchbase/couchbase/lookup_in_options.hxx +119 -0
  768. data/ext/couchbase/couchbase/lookup_in_result.hxx +255 -0
  769. data/ext/couchbase/couchbase/lookup_in_specs.hxx +147 -0
  770. data/ext/couchbase/couchbase/manager_error_context.hxx +136 -0
  771. data/ext/couchbase/couchbase/metrics/meter.hxx +16 -0
  772. data/ext/couchbase/couchbase/metrics/otel_meter.hxx +131 -0
  773. data/ext/couchbase/couchbase/metrics_options.hxx +71 -0
  774. data/ext/couchbase/couchbase/mutate_in_options.hxx +233 -0
  775. data/ext/couchbase/couchbase/mutate_in_result.hxx +173 -0
  776. data/ext/couchbase/couchbase/mutate_in_specs.hxx +528 -0
  777. data/ext/couchbase/couchbase/mutation_result.hxx +73 -0
  778. data/ext/couchbase/couchbase/mutation_state.hxx +73 -0
  779. data/ext/couchbase/couchbase/mutation_token.hxx +93 -6
  780. data/ext/couchbase/couchbase/network_options.hxx +114 -0
  781. data/ext/couchbase/couchbase/password_authenticator.hxx +47 -0
  782. data/ext/couchbase/couchbase/persist_to.hxx +73 -0
  783. data/ext/couchbase/couchbase/prepend_options.hxx +124 -0
  784. data/ext/couchbase/couchbase/query_error_context.hxx +143 -0
  785. data/ext/couchbase/couchbase/query_index_manager.hxx +256 -0
  786. data/ext/couchbase/couchbase/query_meta_data.hxx +171 -0
  787. data/ext/couchbase/couchbase/query_metrics.hxx +179 -0
  788. data/ext/couchbase/couchbase/query_options.hxx +575 -0
  789. data/ext/couchbase/couchbase/query_profile.hxx +52 -0
  790. data/ext/couchbase/couchbase/query_result.hxx +102 -0
  791. data/ext/couchbase/couchbase/query_scan_consistency.hxx +25 -2
  792. data/ext/couchbase/couchbase/query_status.hxx +42 -0
  793. data/ext/couchbase/couchbase/query_warning.hxx +115 -0
  794. data/ext/couchbase/couchbase/remove_options.hxx +123 -0
  795. data/ext/couchbase/couchbase/replace_options.hxx +184 -0
  796. data/ext/couchbase/couchbase/replicate_to.hxx +55 -0
  797. data/ext/couchbase/couchbase/result.hxx +66 -0
  798. data/ext/couchbase/couchbase/retry_action.hxx +41 -0
  799. data/ext/couchbase/couchbase/retry_reason.hxx +107 -0
  800. data/ext/couchbase/couchbase/retry_request.hxx +39 -0
  801. data/ext/couchbase/couchbase/retry_strategy.hxx +35 -0
  802. data/ext/couchbase/couchbase/scope.hxx +149 -0
  803. data/ext/couchbase/couchbase/security_options.hxx +68 -0
  804. data/ext/couchbase/couchbase/store_semantics.hxx +63 -0
  805. data/ext/couchbase/couchbase/subdoc/array_add_unique.hxx +107 -0
  806. data/ext/couchbase/couchbase/subdoc/array_append.hxx +91 -0
  807. data/ext/couchbase/couchbase/subdoc/array_insert.hxx +92 -0
  808. data/ext/couchbase/couchbase/subdoc/array_prepend.hxx +92 -0
  809. data/ext/couchbase/couchbase/subdoc/count.hxx +72 -0
  810. data/ext/couchbase/couchbase/subdoc/counter.hxx +90 -0
  811. data/ext/couchbase/couchbase/subdoc/exists.hxx +72 -0
  812. data/ext/couchbase/couchbase/subdoc/fwd/command.hxx +25 -0
  813. data/ext/couchbase/couchbase/subdoc/fwd/command_bundle.hxx +25 -0
  814. data/ext/couchbase/couchbase/subdoc/get.hxx +80 -0
  815. data/ext/couchbase/couchbase/subdoc/insert.hxx +107 -0
  816. data/ext/couchbase/couchbase/subdoc/lookup_in_macro.hxx +66 -0
  817. data/ext/couchbase/couchbase/subdoc/mutate_in_macro.hxx +54 -0
  818. data/ext/couchbase/couchbase/subdoc/remove.hxx +72 -0
  819. data/ext/couchbase/couchbase/subdoc/replace.hxx +91 -0
  820. data/ext/couchbase/couchbase/subdoc/upsert.hxx +107 -0
  821. data/ext/couchbase/couchbase/subdocument_error_context.hxx +144 -0
  822. data/ext/couchbase/couchbase/timeout_options.hxx +141 -0
  823. data/ext/couchbase/couchbase/tls_verify_mode.hxx +26 -0
  824. data/ext/couchbase/couchbase/touch_options.hxx +94 -0
  825. data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +85 -0
  826. data/ext/couchbase/couchbase/tracing/request_tracer.hxx +17 -2
  827. data/ext/couchbase/couchbase/tracing_options.hxx +174 -0
  828. data/ext/couchbase/couchbase/transaction_error_context.hxx +49 -0
  829. data/ext/couchbase/couchbase/transaction_op_error_context.hxx +76 -0
  830. data/ext/couchbase/couchbase/transactions/async_attempt_context.hxx +78 -0
  831. data/ext/couchbase/couchbase/transactions/attempt_context.hxx +79 -0
  832. data/ext/couchbase/couchbase/transactions/transaction_get_result.hxx +118 -0
  833. data/ext/couchbase/couchbase/transactions/transaction_keyspace.hxx +101 -0
  834. data/ext/couchbase/couchbase/transactions/transaction_options.hxx +115 -0
  835. data/ext/couchbase/couchbase/transactions/transaction_query_options.hxx +159 -0
  836. data/ext/couchbase/couchbase/transactions/transaction_query_result.hxx +36 -0
  837. data/ext/couchbase/couchbase/transactions/transaction_result.hxx +34 -0
  838. data/ext/couchbase/couchbase/transactions/transactions_cleanup_config.hxx +140 -0
  839. data/ext/couchbase/couchbase/transactions/transactions_config.hxx +255 -0
  840. data/ext/couchbase/couchbase/transactions/transactions_query_config.hxx +61 -0
  841. data/ext/couchbase/couchbase/transactions.hxx +43 -0
  842. data/ext/couchbase/couchbase/unlock_options.hxx +97 -0
  843. data/ext/couchbase/couchbase/upsert_options.hxx +158 -0
  844. data/ext/couchbase/couchbase/wan_development_configuration_profile.hxx +44 -0
  845. data/ext/couchbase/couchbase/watch_query_indexes_options.hxx +115 -0
  846. data/ext/couchbase/test/CMakeLists.txt +21 -0
  847. data/ext/couchbase/test/another_simple_object.hxx +50 -0
  848. data/ext/couchbase/test/benchmark_integration_get.cxx +5 -6
  849. data/ext/couchbase/test/profile.hxx +62 -0
  850. data/ext/couchbase/test/simple_object.hxx +53 -0
  851. data/ext/couchbase/test/test_helper.hxx +8 -0
  852. data/ext/couchbase/test/test_helper_integration.hxx +1 -1
  853. data/ext/couchbase/test/test_integration_analytics.cxx +261 -0
  854. data/ext/couchbase/test/test_integration_arithmetic.cxx +119 -20
  855. data/ext/couchbase/test/test_integration_binary_operations.cxx +26 -39
  856. data/ext/couchbase/test/test_integration_collections.cxx +43 -45
  857. data/ext/couchbase/test/test_integration_connect.cxx +35 -25
  858. data/ext/couchbase/test/test_integration_crud.cxx +403 -187
  859. data/ext/couchbase/test/test_integration_diagnostics.cxx +119 -48
  860. data/ext/couchbase/test/test_integration_durability.cxx +171 -26
  861. data/ext/couchbase/test/test_integration_examples.cxx +141 -0
  862. data/ext/couchbase/test/test_integration_management.cxx +1474 -849
  863. data/ext/couchbase/test/test_integration_meter.cxx +182 -0
  864. data/ext/couchbase/test/test_integration_query.cxx +266 -86
  865. data/ext/couchbase/test/test_integration_range_scan.cxx +1067 -0
  866. data/ext/couchbase/test/test_integration_read_replica.cxx +232 -0
  867. data/ext/couchbase/test/test_integration_subdoc.cxx +337 -306
  868. data/ext/couchbase/test/test_integration_tracer.cxx +306 -0
  869. data/ext/couchbase/test/test_integration_transcoders.cxx +588 -0
  870. data/ext/couchbase/test/test_transaction_transaction_context.cxx +550 -0
  871. data/ext/couchbase/test/test_transaction_transaction_public_async_api.cxx +393 -0
  872. data/ext/couchbase/test/test_transaction_transaction_public_blocking_api.cxx +653 -0
  873. data/ext/couchbase/test/test_transaction_transaction_simple.cxx +899 -0
  874. data/ext/couchbase/test/test_transaction_transaction_simple_async.cxx +972 -0
  875. data/ext/couchbase/test/test_unit_config_profiles.cxx +132 -0
  876. data/ext/couchbase/test/test_unit_connection_string.cxx +170 -165
  877. data/ext/couchbase/test/test_unit_json_streaming_lexer.cxx +129 -9
  878. data/ext/couchbase/test/test_unit_json_transcoder.cxx +212 -0
  879. data/ext/couchbase/test/test_unit_jsonsl.cxx +1 -1
  880. data/ext/couchbase/test/test_unit_options.cxx +57 -0
  881. data/ext/couchbase/test/test_unit_transaction_logging.cxx +130 -0
  882. data/ext/couchbase/test/test_unit_transaction_utils.cxx +318 -0
  883. data/ext/couchbase/test/test_unit_utils.cxx +166 -29
  884. data/ext/couchbase/test/test_unit_waitable_op_list.cxx +132 -0
  885. data/ext/couchbase/third_party/asio/asio/include/asio/any_io_executor.hpp +4 -2
  886. data/ext/couchbase/third_party/asio/asio/include/asio/append.hpp +78 -0
  887. data/ext/couchbase/third_party/asio/asio/include/asio/as_tuple.hpp +139 -0
  888. data/ext/couchbase/third_party/asio/asio/include/asio/associated_allocator.hpp +4 -4
  889. data/ext/couchbase/third_party/asio/asio/include/asio/associated_cancellation_slot.hpp +4 -3
  890. data/ext/couchbase/third_party/asio/asio/include/asio/associated_executor.hpp +4 -4
  891. data/ext/couchbase/third_party/asio/asio/include/asio/associator.hpp +1 -1
  892. data/ext/couchbase/third_party/asio/asio/include/asio/async_result.hpp +357 -1
  893. data/ext/couchbase/third_party/asio/asio/include/asio/awaitable.hpp +10 -1
  894. data/ext/couchbase/third_party/asio/asio/include/asio/basic_datagram_socket.hpp +208 -115
  895. data/ext/couchbase/third_party/asio/asio/include/asio/basic_deadline_timer.hpp +28 -16
  896. data/ext/couchbase/third_party/asio/asio/include/asio/basic_file.hpp +2 -2
  897. data/ext/couchbase/third_party/asio/asio/include/asio/basic_io_object.hpp +1 -1
  898. data/ext/couchbase/third_party/asio/asio/include/asio/basic_random_access_file.hpp +51 -27
  899. data/ext/couchbase/third_party/asio/asio/include/asio/basic_raw_socket.hpp +210 -117
  900. data/ext/couchbase/third_party/asio/asio/include/asio/basic_readable_pipe.hpp +127 -15
  901. data/ext/couchbase/third_party/asio/asio/include/asio/basic_seq_packet_socket.hpp +84 -47
  902. data/ext/couchbase/third_party/asio/asio/include/asio/basic_serial_port.hpp +120 -27
  903. data/ext/couchbase/third_party/asio/asio/include/asio/basic_signal_set.hpp +36 -14
  904. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket.hpp +50 -26
  905. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_acceptor.hpp +295 -150
  906. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_iostream.hpp +1 -1
  907. data/ext/couchbase/third_party/asio/asio/include/asio/basic_socket_streambuf.hpp +1 -1
  908. data/ext/couchbase/third_party/asio/asio/include/asio/basic_stream_file.hpp +51 -27
  909. data/ext/couchbase/third_party/asio/asio/include/asio/basic_stream_socket.hpp +153 -84
  910. data/ext/couchbase/third_party/asio/asio/include/asio/basic_streambuf.hpp +1 -1
  911. data/ext/couchbase/third_party/asio/asio/include/asio/basic_streambuf_fwd.hpp +1 -1
  912. data/ext/couchbase/third_party/asio/asio/include/asio/basic_waitable_timer.hpp +28 -16
  913. data/ext/couchbase/third_party/asio/asio/include/asio/basic_writable_pipe.hpp +127 -15
  914. data/ext/couchbase/third_party/asio/asio/include/asio/bind_allocator.hpp +722 -0
  915. data/ext/couchbase/third_party/asio/asio/include/asio/bind_cancellation_slot.hpp +11 -8
  916. data/ext/couchbase/third_party/asio/asio/include/asio/bind_executor.hpp +36 -20
  917. data/ext/couchbase/third_party/asio/asio/include/asio/buffer.hpp +222 -42
  918. data/ext/couchbase/third_party/asio/asio/include/asio/buffer_registration.hpp +2 -1
  919. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_read_stream.hpp +38 -6
  920. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_read_stream_fwd.hpp +1 -1
  921. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_stream.hpp +34 -5
  922. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_stream_fwd.hpp +1 -1
  923. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_write_stream.hpp +38 -6
  924. data/ext/couchbase/third_party/asio/asio/include/asio/buffered_write_stream_fwd.hpp +1 -1
  925. data/ext/couchbase/third_party/asio/asio/include/asio/buffers_iterator.hpp +1 -1
  926. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_signal.hpp +1 -1
  927. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_state.hpp +1 -1
  928. data/ext/couchbase/third_party/asio/asio/include/asio/cancellation_type.hpp +1 -1
  929. data/ext/couchbase/third_party/asio/asio/include/asio/co_spawn.hpp +33 -9
  930. data/ext/couchbase/third_party/asio/asio/include/asio/completion_condition.hpp +1 -1
  931. data/ext/couchbase/third_party/asio/asio/include/asio/compose.hpp +682 -12
  932. data/ext/couchbase/third_party/asio/asio/include/asio/connect.hpp +132 -61
  933. data/ext/couchbase/third_party/asio/asio/include/asio/connect_pipe.hpp +1 -1
  934. data/ext/couchbase/third_party/asio/asio/include/asio/coroutine.hpp +1 -1
  935. data/ext/couchbase/third_party/asio/asio/include/asio/deadline_timer.hpp +1 -1
  936. data/ext/couchbase/third_party/asio/asio/include/asio/defer.hpp +128 -42
  937. data/ext/couchbase/third_party/asio/asio/include/asio/deferred.hpp +675 -0
  938. data/ext/couchbase/third_party/asio/asio/include/asio/detached.hpp +6 -5
  939. data/ext/couchbase/third_party/asio/asio/include/asio/detail/array.hpp +1 -1
  940. data/ext/couchbase/third_party/asio/asio/include/asio/detail/array_fwd.hpp +1 -1
  941. data/ext/couchbase/third_party/asio/asio/include/asio/detail/assert.hpp +1 -1
  942. data/ext/couchbase/third_party/asio/asio/include/asio/detail/atomic_count.hpp +1 -1
  943. data/ext/couchbase/third_party/asio/asio/include/asio/detail/base_from_cancellation_state.hpp +1 -1
  944. data/ext/couchbase/third_party/asio/asio/include/asio/detail/base_from_completion_cond.hpp +1 -1
  945. data/ext/couchbase/third_party/asio/asio/include/asio/detail/bind_handler.hpp +1 -1
  946. data/ext/couchbase/third_party/asio/asio/include/asio/detail/blocking_executor_op.hpp +1 -1
  947. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffer_resize_guard.hpp +1 -1
  948. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffer_sequence_adapter.hpp +1 -1
  949. data/ext/couchbase/third_party/asio/asio/include/asio/detail/buffered_stream_storage.hpp +1 -1
  950. data/ext/couchbase/third_party/asio/asio/include/asio/detail/bulk_executor_op.hpp +1 -1
  951. data/ext/couchbase/third_party/asio/asio/include/asio/detail/call_stack.hpp +1 -1
  952. data/ext/couchbase/third_party/asio/asio/include/asio/detail/chrono.hpp +1 -1
  953. data/ext/couchbase/third_party/asio/asio/include/asio/detail/chrono_time_traits.hpp +1 -1
  954. data/ext/couchbase/third_party/asio/asio/include/asio/detail/completion_handler.hpp +1 -1
  955. data/ext/couchbase/third_party/asio/asio/include/asio/detail/concurrency_hint.hpp +1 -1
  956. data/ext/couchbase/third_party/asio/asio/include/asio/detail/conditionally_enabled_event.hpp +1 -1
  957. data/ext/couchbase/third_party/asio/asio/include/asio/detail/conditionally_enabled_mutex.hpp +1 -1
  958. data/ext/couchbase/third_party/asio/asio/include/asio/detail/config.hpp +201 -11
  959. data/ext/couchbase/third_party/asio/asio/include/asio/detail/consuming_buffers.hpp +1 -1
  960. data/ext/couchbase/third_party/asio/asio/include/asio/detail/cstddef.hpp +1 -1
  961. data/ext/couchbase/third_party/asio/asio/include/asio/detail/cstdint.hpp +1 -1
  962. data/ext/couchbase/third_party/asio/asio/include/asio/detail/date_time_fwd.hpp +1 -1
  963. data/ext/couchbase/third_party/asio/asio/include/asio/detail/deadline_timer_service.hpp +1 -1
  964. data/ext/couchbase/third_party/asio/asio/include/asio/detail/dependent_type.hpp +1 -1
  965. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_ops.hpp +2 -2
  966. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_read_op.hpp +3 -1
  967. data/ext/couchbase/third_party/asio/asio/include/asio/detail/descriptor_write_op.hpp +3 -1
  968. data/ext/couchbase/third_party/asio/asio/include/asio/detail/dev_poll_reactor.hpp +1 -1
  969. data/ext/couchbase/third_party/asio/asio/include/asio/detail/epoll_reactor.hpp +1 -1
  970. data/ext/couchbase/third_party/asio/asio/include/asio/detail/event.hpp +1 -1
  971. data/ext/couchbase/third_party/asio/asio/include/asio/detail/eventfd_select_interrupter.hpp +1 -1
  972. data/ext/couchbase/third_party/asio/asio/include/asio/detail/exception.hpp +40 -0
  973. data/ext/couchbase/third_party/asio/asio/include/asio/detail/executor_function.hpp +1 -1
  974. data/ext/couchbase/third_party/asio/asio/include/asio/detail/executor_op.hpp +1 -1
  975. data/ext/couchbase/third_party/asio/asio/include/asio/detail/fd_set_adapter.hpp +1 -1
  976. data/ext/couchbase/third_party/asio/asio/include/asio/detail/fenced_block.hpp +1 -1
  977. data/ext/couchbase/third_party/asio/asio/include/asio/detail/functional.hpp +1 -1
  978. data/ext/couchbase/third_party/asio/asio/include/asio/detail/future.hpp +1 -1
  979. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_arm_fenced_block.hpp +1 -1
  980. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_hppa_fenced_block.hpp +1 -1
  981. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_sync_fenced_block.hpp +1 -1
  982. data/ext/couchbase/third_party/asio/asio/include/asio/detail/gcc_x86_fenced_block.hpp +2 -2
  983. data/ext/couchbase/third_party/asio/asio/include/asio/detail/global.hpp +1 -1
  984. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_alloc_helpers.hpp +1 -1
  985. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_cont_helpers.hpp +1 -1
  986. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_invoke_helpers.hpp +1 -1
  987. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_tracking.hpp +1 -1
  988. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_type_requirements.hpp +1 -1
  989. data/ext/couchbase/third_party/asio/asio/include/asio/detail/handler_work.hpp +1 -1
  990. data/ext/couchbase/third_party/asio/asio/include/asio/detail/hash_map.hpp +1 -1
  991. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/buffer_sequence_adapter.ipp +1 -1
  992. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/descriptor_ops.ipp +9 -9
  993. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/dev_poll_reactor.hpp +1 -1
  994. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/dev_poll_reactor.ipp +1 -1
  995. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/epoll_reactor.hpp +1 -1
  996. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/epoll_reactor.ipp +1 -1
  997. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/eventfd_select_interrupter.ipp +1 -1
  998. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/handler_tracking.ipp +1 -1
  999. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_descriptor_service.ipp +4 -1
  1000. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_file_service.ipp +10 -1
  1001. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_service.hpp +1 -1
  1002. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_service.ipp +8 -7
  1003. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/io_uring_socket_service_base.ipp +1 -1
  1004. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/kqueue_reactor.hpp +1 -1
  1005. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/kqueue_reactor.ipp +1 -1
  1006. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/null_event.ipp +1 -1
  1007. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/pipe_select_interrupter.ipp +1 -1
  1008. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_event.ipp +1 -1
  1009. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_mutex.ipp +1 -1
  1010. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_serial_port_service.ipp +21 -2
  1011. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_thread.ipp +1 -1
  1012. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/posix_tss_ptr.ipp +1 -1
  1013. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/reactive_descriptor_service.ipp +6 -1
  1014. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/reactive_socket_service_base.ipp +3 -3
  1015. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/resolver_service_base.ipp +1 -1
  1016. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/scheduler.ipp +1 -1
  1017. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/select_reactor.hpp +1 -1
  1018. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/select_reactor.ipp +36 -1
  1019. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/service_registry.hpp +1 -1
  1020. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/service_registry.ipp +1 -1
  1021. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/signal_set_service.ipp +28 -1
  1022. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/socket_ops.ipp +126 -121
  1023. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/socket_select_interrupter.ipp +4 -4
  1024. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_executor_service.hpp +1 -1
  1025. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_executor_service.ipp +1 -1
  1026. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_service.hpp +1 -1
  1027. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/strand_service.ipp +1 -1
  1028. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/thread_context.ipp +1 -1
  1029. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/throw_error.ipp +13 -9
  1030. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/timer_queue_ptime.ipp +1 -1
  1031. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/timer_queue_set.ipp +1 -1
  1032. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_event.ipp +1 -1
  1033. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_file_service.ipp +21 -7
  1034. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_handle_service.ipp +94 -1
  1035. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_io_context.hpp +1 -1
  1036. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_io_context.ipp +1 -1
  1037. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_serial_port_service.ipp +9 -1
  1038. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp +11 -11
  1039. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_mutex.ipp +1 -1
  1040. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_object_handle_service.ipp +5 -1
  1041. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_static_mutex.ipp +1 -1
  1042. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_thread.ipp +1 -1
  1043. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/win_tss_ptr.ipp +1 -1
  1044. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_ssocket_service_base.ipp +4 -4
  1045. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_timer_scheduler.hpp +1 -1
  1046. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winrt_timer_scheduler.ipp +1 -1
  1047. data/ext/couchbase/third_party/asio/asio/include/asio/detail/impl/winsock_init.ipp +1 -1
  1048. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_control.hpp +1 -1
  1049. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_object_impl.hpp +11 -2
  1050. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_read_at_op.hpp +3 -1
  1051. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_read_op.hpp +3 -1
  1052. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_service.hpp +26 -8
  1053. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_write_at_op.hpp +3 -1
  1054. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_descriptor_write_op.hpp +3 -1
  1055. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_file_service.hpp +12 -1
  1056. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_null_buffers_op.hpp +3 -1
  1057. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_operation.hpp +1 -1
  1058. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_service.hpp +2 -2
  1059. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_accept_op.hpp +5 -1
  1060. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_connect_op.hpp +3 -1
  1061. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recv_op.hpp +3 -1
  1062. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recvfrom_op.hpp +4 -2
  1063. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_recvmsg_op.hpp +3 -1
  1064. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_send_op.hpp +3 -1
  1065. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_sendto_op.hpp +3 -1
  1066. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_service.hpp +31 -13
  1067. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_socket_service_base.hpp +1 -1
  1068. data/ext/couchbase/third_party/asio/asio/include/asio/detail/io_uring_wait_op.hpp +3 -1
  1069. data/ext/couchbase/third_party/asio/asio/include/asio/detail/is_buffer_sequence.hpp +1 -1
  1070. data/ext/couchbase/third_party/asio/asio/include/asio/detail/is_executor.hpp +1 -1
  1071. data/ext/couchbase/third_party/asio/asio/include/asio/detail/keyword_tss_ptr.hpp +1 -1
  1072. data/ext/couchbase/third_party/asio/asio/include/asio/detail/kqueue_reactor.hpp +1 -1
  1073. data/ext/couchbase/third_party/asio/asio/include/asio/detail/local_free_on_block_exit.hpp +1 -1
  1074. data/ext/couchbase/third_party/asio/asio/include/asio/detail/macos_fenced_block.hpp +1 -1
  1075. data/ext/couchbase/third_party/asio/asio/include/asio/detail/memory.hpp +17 -1
  1076. data/ext/couchbase/third_party/asio/asio/include/asio/detail/mutex.hpp +1 -1
  1077. data/ext/couchbase/third_party/asio/asio/include/asio/detail/non_const_lvalue.hpp +1 -1
  1078. data/ext/couchbase/third_party/asio/asio/include/asio/detail/noncopyable.hpp +1 -1
  1079. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_event.hpp +1 -1
  1080. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_fenced_block.hpp +1 -1
  1081. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_global.hpp +1 -1
  1082. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_mutex.hpp +1 -1
  1083. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_reactor.hpp +1 -1
  1084. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_signal_blocker.hpp +1 -1
  1085. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_socket_service.hpp +1 -1
  1086. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_static_mutex.hpp +1 -1
  1087. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_thread.hpp +1 -1
  1088. data/ext/couchbase/third_party/asio/asio/include/asio/detail/null_tss_ptr.hpp +1 -1
  1089. data/ext/couchbase/third_party/asio/asio/include/asio/detail/object_pool.hpp +1 -1
  1090. data/ext/couchbase/third_party/asio/asio/include/asio/detail/old_win_sdk_compat.hpp +1 -1
  1091. data/ext/couchbase/third_party/asio/asio/include/asio/detail/op_queue.hpp +1 -1
  1092. data/ext/couchbase/third_party/asio/asio/include/asio/detail/operation.hpp +1 -1
  1093. data/ext/couchbase/third_party/asio/asio/include/asio/detail/pipe_select_interrupter.hpp +1 -1
  1094. data/ext/couchbase/third_party/asio/asio/include/asio/detail/pop_options.hpp +5 -1
  1095. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_event.hpp +1 -1
  1096. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_fd_set_adapter.hpp +1 -1
  1097. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_global.hpp +1 -1
  1098. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_mutex.hpp +1 -1
  1099. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_serial_port_service.hpp +2 -1
  1100. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_signal_blocker.hpp +1 -1
  1101. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_static_mutex.hpp +1 -1
  1102. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_thread.hpp +1 -1
  1103. data/ext/couchbase/third_party/asio/asio/include/asio/detail/posix_tss_ptr.hpp +1 -1
  1104. data/ext/couchbase/third_party/asio/asio/include/asio/detail/push_options.hpp +11 -2
  1105. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_descriptor_service.hpp +26 -7
  1106. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_null_buffers_op.hpp +1 -1
  1107. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_accept_op.hpp +5 -1
  1108. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_connect_op.hpp +3 -1
  1109. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recv_op.hpp +3 -1
  1110. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recvfrom_op.hpp +3 -1
  1111. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_recvmsg_op.hpp +3 -1
  1112. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_send_op.hpp +3 -1
  1113. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_sendto_op.hpp +3 -1
  1114. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_service.hpp +38 -12
  1115. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_socket_service_base.hpp +2 -3
  1116. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactive_wait_op.hpp +1 -1
  1117. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor.hpp +1 -1
  1118. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor_op.hpp +1 -1
  1119. data/ext/couchbase/third_party/asio/asio/include/asio/detail/reactor_op_queue.hpp +1 -1
  1120. data/ext/couchbase/third_party/asio/asio/include/asio/detail/recycling_allocator.hpp +1 -1
  1121. data/ext/couchbase/third_party/asio/asio/include/asio/detail/regex_fwd.hpp +1 -1
  1122. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_endpoint_op.hpp +1 -1
  1123. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_op.hpp +1 -1
  1124. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolve_query_op.hpp +1 -1
  1125. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolver_service.hpp +3 -1
  1126. data/ext/couchbase/third_party/asio/asio/include/asio/detail/resolver_service_base.hpp +1 -1
  1127. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler.hpp +1 -1
  1128. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_operation.hpp +1 -1
  1129. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_task.hpp +1 -1
  1130. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scheduler_thread_info.hpp +1 -1
  1131. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scoped_lock.hpp +1 -1
  1132. data/ext/couchbase/third_party/asio/asio/include/asio/detail/scoped_ptr.hpp +1 -1
  1133. data/ext/couchbase/third_party/asio/asio/include/asio/detail/select_interrupter.hpp +1 -1
  1134. data/ext/couchbase/third_party/asio/asio/include/asio/detail/select_reactor.hpp +23 -1
  1135. data/ext/couchbase/third_party/asio/asio/include/asio/detail/service_registry.hpp +1 -1
  1136. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_blocker.hpp +1 -1
  1137. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_handler.hpp +1 -1
  1138. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_init.hpp +1 -1
  1139. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_op.hpp +5 -1
  1140. data/ext/couchbase/third_party/asio/asio/include/asio/detail/signal_set_service.hpp +43 -1
  1141. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_holder.hpp +1 -1
  1142. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_ops.hpp +37 -45
  1143. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_option.hpp +1 -1
  1144. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_select_interrupter.hpp +1 -1
  1145. data/ext/couchbase/third_party/asio/asio/include/asio/detail/socket_types.hpp +1 -1
  1146. data/ext/couchbase/third_party/asio/asio/include/asio/detail/solaris_fenced_block.hpp +1 -1
  1147. data/ext/couchbase/third_party/asio/asio/include/asio/detail/source_location.hpp +1 -1
  1148. data/ext/couchbase/third_party/asio/asio/include/asio/detail/static_mutex.hpp +1 -1
  1149. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_event.hpp +1 -1
  1150. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_fenced_block.hpp +1 -1
  1151. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_global.hpp +1 -1
  1152. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_mutex.hpp +1 -1
  1153. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_static_mutex.hpp +1 -1
  1154. data/ext/couchbase/third_party/asio/asio/include/asio/detail/std_thread.hpp +1 -1
  1155. data/ext/couchbase/third_party/asio/asio/include/asio/detail/strand_executor_service.hpp +1 -1
  1156. data/ext/couchbase/third_party/asio/asio/include/asio/detail/strand_service.hpp +1 -1
  1157. data/ext/couchbase/third_party/asio/asio/include/asio/detail/string_view.hpp +1 -1
  1158. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread.hpp +1 -1
  1159. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_context.hpp +1 -1
  1160. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_group.hpp +1 -1
  1161. data/ext/couchbase/third_party/asio/asio/include/asio/detail/thread_info_base.hpp +1 -1
  1162. data/ext/couchbase/third_party/asio/asio/include/asio/detail/throw_error.hpp +18 -9
  1163. data/ext/couchbase/third_party/asio/asio/include/asio/detail/throw_exception.hpp +7 -3
  1164. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue.hpp +1 -1
  1165. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_base.hpp +1 -1
  1166. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_ptime.hpp +1 -1
  1167. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_queue_set.hpp +1 -1
  1168. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_scheduler.hpp +1 -1
  1169. data/ext/couchbase/third_party/asio/asio/include/asio/detail/timer_scheduler_fwd.hpp +1 -1
  1170. data/ext/couchbase/third_party/asio/asio/include/asio/detail/tss_ptr.hpp +1 -1
  1171. data/ext/couchbase/third_party/asio/asio/include/asio/detail/type_traits.hpp +9 -1
  1172. data/ext/couchbase/third_party/asio/asio/include/asio/detail/utility.hpp +84 -0
  1173. data/ext/couchbase/third_party/asio/asio/include/asio/detail/variadic_templates.hpp +1 -1
  1174. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wait_handler.hpp +1 -1
  1175. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wait_op.hpp +1 -1
  1176. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_event.hpp +1 -1
  1177. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_fd_set_adapter.hpp +1 -1
  1178. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_fenced_block.hpp +1 -1
  1179. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_global.hpp +1 -1
  1180. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_file_service.hpp +8 -1
  1181. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_read_op.hpp +3 -1
  1182. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_service.hpp +29 -1
  1183. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_handle_write_op.hpp +6 -2
  1184. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_io_context.hpp +1 -1
  1185. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_null_buffers_op.hpp +3 -1
  1186. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_operation.hpp +1 -1
  1187. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_overlapped_op.hpp +6 -2
  1188. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_overlapped_ptr.hpp +1 -1
  1189. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_serial_port_service.hpp +2 -1
  1190. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_accept_op.hpp +5 -1
  1191. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_connect_op.hpp +3 -1
  1192. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recv_op.hpp +3 -1
  1193. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recvfrom_op.hpp +3 -1
  1194. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_recvmsg_op.hpp +3 -1
  1195. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_send_op.hpp +3 -1
  1196. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_service.hpp +32 -8
  1197. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_socket_service_base.hpp +6 -8
  1198. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_thread_info.hpp +1 -1
  1199. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_iocp_wait_op.hpp +3 -1
  1200. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_mutex.hpp +1 -1
  1201. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_object_handle_service.hpp +1 -1
  1202. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_static_mutex.hpp +1 -1
  1203. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_thread.hpp +1 -1
  1204. data/ext/couchbase/third_party/asio/asio/include/asio/detail/win_tss_ptr.hpp +1 -1
  1205. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winapp_thread.hpp +1 -1
  1206. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wince_thread.hpp +1 -1
  1207. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_async_manager.hpp +1 -1
  1208. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_async_op.hpp +1 -1
  1209. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_resolve_op.hpp +1 -1
  1210. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_resolver_service.hpp +1 -1
  1211. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_connect_op.hpp +1 -1
  1212. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_recv_op.hpp +1 -1
  1213. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_socket_send_op.hpp +1 -1
  1214. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_ssocket_service.hpp +1 -1
  1215. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_ssocket_service_base.hpp +1 -1
  1216. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_timer_scheduler.hpp +1 -1
  1217. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winrt_utils.hpp +1 -1
  1218. data/ext/couchbase/third_party/asio/asio/include/asio/detail/winsock_init.hpp +1 -1
  1219. data/ext/couchbase/third_party/asio/asio/include/asio/detail/work_dispatcher.hpp +4 -2
  1220. data/ext/couchbase/third_party/asio/asio/include/asio/detail/wrapped_handler.hpp +1 -1
  1221. data/ext/couchbase/third_party/asio/asio/include/asio/dispatch.hpp +126 -42
  1222. data/ext/couchbase/third_party/asio/asio/include/asio/error.hpp +36 -1
  1223. data/ext/couchbase/third_party/asio/asio/include/asio/error_code.hpp +1 -1
  1224. data/ext/couchbase/third_party/asio/asio/include/asio/execution/allocator.hpp +1 -1
  1225. data/ext/couchbase/third_party/asio/asio/include/asio/execution/any_executor.hpp +1 -1
  1226. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bad_executor.hpp +1 -1
  1227. data/ext/couchbase/third_party/asio/asio/include/asio/execution/blocking.hpp +1 -1
  1228. data/ext/couchbase/third_party/asio/asio/include/asio/execution/blocking_adaptation.hpp +1 -1
  1229. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bulk_execute.hpp +1 -1
  1230. data/ext/couchbase/third_party/asio/asio/include/asio/execution/bulk_guarantee.hpp +1 -1
  1231. data/ext/couchbase/third_party/asio/asio/include/asio/execution/connect.hpp +1 -1
  1232. data/ext/couchbase/third_party/asio/asio/include/asio/execution/context.hpp +1 -1
  1233. data/ext/couchbase/third_party/asio/asio/include/asio/execution/context_as.hpp +1 -1
  1234. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_invocable.hpp +1 -1
  1235. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_operation.hpp +1 -1
  1236. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/as_receiver.hpp +1 -1
  1237. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/bulk_sender.hpp +1 -1
  1238. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/submit_receiver.hpp +1 -1
  1239. data/ext/couchbase/third_party/asio/asio/include/asio/execution/detail/void_receiver.hpp +1 -1
  1240. data/ext/couchbase/third_party/asio/asio/include/asio/execution/execute.hpp +1 -1
  1241. data/ext/couchbase/third_party/asio/asio/include/asio/execution/executor.hpp +1 -1
  1242. data/ext/couchbase/third_party/asio/asio/include/asio/execution/impl/bad_executor.ipp +1 -1
  1243. data/ext/couchbase/third_party/asio/asio/include/asio/execution/impl/receiver_invocation_error.ipp +1 -1
  1244. data/ext/couchbase/third_party/asio/asio/include/asio/execution/invocable_archetype.hpp +1 -1
  1245. data/ext/couchbase/third_party/asio/asio/include/asio/execution/mapping.hpp +1 -1
  1246. data/ext/couchbase/third_party/asio/asio/include/asio/execution/occupancy.hpp +1 -1
  1247. data/ext/couchbase/third_party/asio/asio/include/asio/execution/operation_state.hpp +1 -1
  1248. data/ext/couchbase/third_party/asio/asio/include/asio/execution/outstanding_work.hpp +1 -1
  1249. data/ext/couchbase/third_party/asio/asio/include/asio/execution/prefer_only.hpp +1 -1
  1250. data/ext/couchbase/third_party/asio/asio/include/asio/execution/receiver.hpp +1 -1
  1251. data/ext/couchbase/third_party/asio/asio/include/asio/execution/receiver_invocation_error.hpp +1 -1
  1252. data/ext/couchbase/third_party/asio/asio/include/asio/execution/relationship.hpp +1 -1
  1253. data/ext/couchbase/third_party/asio/asio/include/asio/execution/schedule.hpp +1 -1
  1254. data/ext/couchbase/third_party/asio/asio/include/asio/execution/scheduler.hpp +1 -1
  1255. data/ext/couchbase/third_party/asio/asio/include/asio/execution/sender.hpp +1 -1
  1256. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_done.hpp +1 -1
  1257. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_error.hpp +1 -1
  1258. data/ext/couchbase/third_party/asio/asio/include/asio/execution/set_value.hpp +1 -1
  1259. data/ext/couchbase/third_party/asio/asio/include/asio/execution/start.hpp +1 -1
  1260. data/ext/couchbase/third_party/asio/asio/include/asio/execution/submit.hpp +1 -1
  1261. data/ext/couchbase/third_party/asio/asio/include/asio/execution.hpp +1 -1
  1262. data/ext/couchbase/third_party/asio/asio/include/asio/execution_context.hpp +1 -1
  1263. data/ext/couchbase/third_party/asio/asio/include/asio/executor.hpp +1 -1
  1264. data/ext/couchbase/third_party/asio/asio/include/asio/executor_work_guard.hpp +100 -32
  1265. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/append.hpp +6 -41
  1266. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/as_single.hpp +6 -5
  1267. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/as_tuple.hpp +6 -101
  1268. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/awaitable_operators.hpp +14 -14
  1269. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/basic_channel.hpp +78 -2
  1270. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/basic_concurrent_channel.hpp +69 -2
  1271. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/cancellation_condition.hpp +1 -1
  1272. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel.hpp +1 -1
  1273. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_error.hpp +1 -1
  1274. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/channel_traits.hpp +1 -1
  1275. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/co_spawn.hpp +12 -16
  1276. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/concurrent_channel.hpp +1 -1
  1277. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/coro.hpp +4 -4
  1278. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/coro_traits.hpp +2 -2
  1279. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/deferred.hpp +6 -575
  1280. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_handler.hpp +1 -1
  1281. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_message.hpp +1 -1
  1282. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_operation.hpp +1 -1
  1283. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_payload.hpp +1 -1
  1284. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_receive_op.hpp +1 -1
  1285. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_send_functions.hpp +2 -1
  1286. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_send_op.hpp +1 -1
  1287. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/channel_service.hpp +1 -1
  1288. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/completion_handler_erasure.hpp +82 -46
  1289. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/coro_promise_allocator.hpp +2 -2
  1290. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/has_signature.hpp +1 -1
  1291. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/impl/channel_service.hpp +6 -8
  1292. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/detail/partial_promise.hpp +2 -2
  1293. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/as_single.hpp +1 -1
  1294. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/channel_error.ipp +1 -1
  1295. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/coro.hpp +47 -56
  1296. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/parallel_group.hpp +14 -28
  1297. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/promise.hpp +2 -2
  1298. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/use_coro.hpp +3 -2
  1299. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/parallel_group.hpp +27 -37
  1300. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/prepend.hpp +6 -41
  1301. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/promise.hpp +23 -405
  1302. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/use_coro.hpp +5 -5
  1303. data/ext/couchbase/third_party/asio/asio/include/asio/file_base.hpp +9 -3
  1304. data/ext/couchbase/third_party/asio/asio/include/asio/generic/basic_endpoint.hpp +1 -1
  1305. data/ext/couchbase/third_party/asio/asio/include/asio/generic/datagram_protocol.hpp +1 -1
  1306. data/ext/couchbase/third_party/asio/asio/include/asio/generic/detail/endpoint.hpp +1 -1
  1307. data/ext/couchbase/third_party/asio/asio/include/asio/generic/detail/impl/endpoint.ipp +1 -1
  1308. data/ext/couchbase/third_party/asio/asio/include/asio/generic/raw_protocol.hpp +1 -1
  1309. data/ext/couchbase/third_party/asio/asio/include/asio/generic/seq_packet_protocol.hpp +1 -1
  1310. data/ext/couchbase/third_party/asio/asio/include/asio/generic/stream_protocol.hpp +1 -1
  1311. data/ext/couchbase/third_party/asio/asio/include/asio/handler_alloc_hook.hpp +1 -1
  1312. data/ext/couchbase/third_party/asio/asio/include/asio/handler_continuation_hook.hpp +1 -1
  1313. data/ext/couchbase/third_party/asio/asio/include/asio/handler_invoke_hook.hpp +1 -1
  1314. data/ext/couchbase/third_party/asio/asio/include/asio/high_resolution_timer.hpp +1 -1
  1315. data/ext/couchbase/third_party/asio/asio/include/asio/impl/any_io_executor.ipp +6 -1
  1316. data/ext/couchbase/third_party/asio/asio/include/asio/impl/append.hpp +216 -0
  1317. data/ext/couchbase/third_party/asio/asio/include/asio/impl/as_tuple.hpp +244 -0
  1318. data/ext/couchbase/third_party/asio/asio/include/asio/impl/awaitable.hpp +400 -5
  1319. data/ext/couchbase/third_party/asio/asio/include/asio/impl/buffered_read_stream.hpp +13 -3
  1320. data/ext/couchbase/third_party/asio/asio/include/asio/impl/buffered_write_stream.hpp +13 -3
  1321. data/ext/couchbase/third_party/asio/asio/include/asio/impl/cancellation_signal.ipp +1 -1
  1322. data/ext/couchbase/third_party/asio/asio/include/asio/impl/co_spawn.hpp +71 -7
  1323. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect.hpp +63 -31
  1324. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect_pipe.hpp +1 -1
  1325. data/ext/couchbase/third_party/asio/asio/include/asio/impl/connect_pipe.ipp +2 -2
  1326. data/ext/couchbase/third_party/asio/asio/include/asio/impl/defer.hpp +23 -13
  1327. data/ext/couchbase/third_party/asio/asio/include/asio/impl/deferred.hpp +95 -0
  1328. data/ext/couchbase/third_party/asio/asio/include/asio/impl/detached.hpp +1 -1
  1329. data/ext/couchbase/third_party/asio/asio/include/asio/impl/dispatch.hpp +23 -13
  1330. data/ext/couchbase/third_party/asio/asio/include/asio/impl/error.ipp +1 -1
  1331. data/ext/couchbase/third_party/asio/asio/include/asio/impl/error_code.ipp +1 -1
  1332. data/ext/couchbase/third_party/asio/asio/include/asio/impl/execution_context.hpp +1 -1
  1333. data/ext/couchbase/third_party/asio/asio/include/asio/impl/execution_context.ipp +1 -1
  1334. data/ext/couchbase/third_party/asio/asio/include/asio/impl/executor.hpp +1 -1
  1335. data/ext/couchbase/third_party/asio/asio/include/asio/impl/executor.ipp +1 -1
  1336. data/ext/couchbase/third_party/asio/asio/include/asio/impl/handler_alloc_hook.ipp +1 -1
  1337. data/ext/couchbase/third_party/asio/asio/include/asio/impl/io_context.hpp +9 -3
  1338. data/ext/couchbase/third_party/asio/asio/include/asio/impl/io_context.ipp +1 -1
  1339. data/ext/couchbase/third_party/asio/asio/include/asio/impl/multiple_exceptions.ipp +1 -1
  1340. data/ext/couchbase/third_party/asio/asio/include/asio/impl/post.hpp +23 -13
  1341. data/ext/couchbase/third_party/asio/asio/include/asio/impl/prepend.hpp +216 -0
  1342. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read.hpp +97 -51
  1343. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read_at.hpp +51 -31
  1344. data/ext/couchbase/third_party/asio/asio/include/asio/impl/read_until.hpp +119 -59
  1345. data/ext/couchbase/third_party/asio/asio/include/asio/impl/redirect_error.hpp +1 -1
  1346. data/ext/couchbase/third_party/asio/asio/include/asio/impl/serial_port_base.hpp +1 -1
  1347. data/ext/couchbase/third_party/asio/asio/include/asio/impl/serial_port_base.ipp +1 -1
  1348. data/ext/couchbase/third_party/asio/asio/include/asio/impl/spawn.hpp +1321 -277
  1349. data/ext/couchbase/third_party/asio/asio/include/asio/impl/src.hpp +1 -1
  1350. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_context.hpp +1 -1
  1351. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_context.ipp +1 -1
  1352. data/ext/couchbase/third_party/asio/asio/include/asio/impl/system_executor.hpp +1 -1
  1353. data/ext/couchbase/third_party/asio/asio/include/asio/impl/thread_pool.hpp +1 -1
  1354. data/ext/couchbase/third_party/asio/asio/include/asio/impl/thread_pool.ipp +1 -1
  1355. data/ext/couchbase/third_party/asio/asio/include/asio/impl/use_awaitable.hpp +18 -8
  1356. data/ext/couchbase/third_party/asio/asio/include/asio/impl/use_future.hpp +1 -1
  1357. data/ext/couchbase/third_party/asio/asio/include/asio/impl/write.hpp +95 -50
  1358. data/ext/couchbase/third_party/asio/asio/include/asio/impl/write_at.hpp +53 -31
  1359. data/ext/couchbase/third_party/asio/asio/include/asio/io_context.hpp +25 -38
  1360. data/ext/couchbase/third_party/asio/asio/include/asio/io_context_strand.hpp +15 -3
  1361. data/ext/couchbase/third_party/asio/asio/include/asio/io_service.hpp +1 -1
  1362. data/ext/couchbase/third_party/asio/asio/include/asio/io_service_strand.hpp +1 -1
  1363. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address.hpp +1 -1
  1364. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4.hpp +75 -1
  1365. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4_iterator.hpp +1 -1
  1366. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v4_range.hpp +1 -1
  1367. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6.hpp +35 -1
  1368. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6_iterator.hpp +1 -1
  1369. data/ext/couchbase/third_party/asio/asio/include/asio/ip/address_v6_range.hpp +1 -1
  1370. data/ext/couchbase/third_party/asio/asio/include/asio/ip/bad_address_cast.hpp +1 -1
  1371. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_endpoint.hpp +1 -1
  1372. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver.hpp +130 -64
  1373. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_entry.hpp +1 -1
  1374. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_iterator.hpp +1 -1
  1375. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_query.hpp +1 -1
  1376. data/ext/couchbase/third_party/asio/asio/include/asio/ip/basic_resolver_results.hpp +1 -1
  1377. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/endpoint.hpp +1 -1
  1378. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/impl/endpoint.ipp +1 -1
  1379. data/ext/couchbase/third_party/asio/asio/include/asio/ip/detail/socket_option.hpp +1 -1
  1380. data/ext/couchbase/third_party/asio/asio/include/asio/ip/host_name.hpp +1 -1
  1381. data/ext/couchbase/third_party/asio/asio/include/asio/ip/icmp.hpp +1 -1
  1382. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address.hpp +1 -1
  1383. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address.ipp +1 -1
  1384. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v4.hpp +1 -1
  1385. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v4.ipp +1 -1
  1386. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v6.hpp +1 -1
  1387. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/address_v6.ipp +1 -1
  1388. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/basic_endpoint.hpp +1 -1
  1389. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/host_name.ipp +1 -1
  1390. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v4.hpp +1 -1
  1391. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v4.ipp +1 -1
  1392. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v6.hpp +1 -1
  1393. data/ext/couchbase/third_party/asio/asio/include/asio/ip/impl/network_v6.ipp +1 -1
  1394. data/ext/couchbase/third_party/asio/asio/include/asio/ip/multicast.hpp +1 -1
  1395. data/ext/couchbase/third_party/asio/asio/include/asio/ip/network_v4.hpp +1 -1
  1396. data/ext/couchbase/third_party/asio/asio/include/asio/ip/network_v6.hpp +1 -1
  1397. data/ext/couchbase/third_party/asio/asio/include/asio/ip/resolver_base.hpp +1 -1
  1398. data/ext/couchbase/third_party/asio/asio/include/asio/ip/resolver_query_base.hpp +1 -1
  1399. data/ext/couchbase/third_party/asio/asio/include/asio/ip/tcp.hpp +1 -1
  1400. data/ext/couchbase/third_party/asio/asio/include/asio/ip/udp.hpp +1 -1
  1401. data/ext/couchbase/third_party/asio/asio/include/asio/ip/unicast.hpp +1 -1
  1402. data/ext/couchbase/third_party/asio/asio/include/asio/ip/v6_only.hpp +2 -2
  1403. data/ext/couchbase/third_party/asio/asio/include/asio/is_applicable_property.hpp +1 -1
  1404. data/ext/couchbase/third_party/asio/asio/include/asio/is_contiguous_iterator.hpp +45 -0
  1405. data/ext/couchbase/third_party/asio/asio/include/asio/is_executor.hpp +1 -1
  1406. data/ext/couchbase/third_party/asio/asio/include/asio/is_read_buffered.hpp +1 -1
  1407. data/ext/couchbase/third_party/asio/asio/include/asio/is_write_buffered.hpp +1 -1
  1408. data/ext/couchbase/third_party/asio/asio/include/asio/local/basic_endpoint.hpp +1 -1
  1409. data/ext/couchbase/third_party/asio/asio/include/asio/local/connect_pair.hpp +1 -1
  1410. data/ext/couchbase/third_party/asio/asio/include/asio/local/datagram_protocol.hpp +1 -1
  1411. data/ext/couchbase/third_party/asio/asio/include/asio/local/detail/endpoint.hpp +1 -1
  1412. data/ext/couchbase/third_party/asio/asio/include/asio/local/detail/impl/endpoint.ipp +1 -1
  1413. data/ext/couchbase/third_party/asio/asio/include/asio/local/stream_protocol.hpp +1 -1
  1414. data/ext/couchbase/third_party/asio/asio/include/asio/multiple_exceptions.hpp +1 -1
  1415. data/ext/couchbase/third_party/asio/asio/include/asio/packaged_task.hpp +1 -1
  1416. data/ext/couchbase/third_party/asio/asio/include/asio/placeholders.hpp +1 -1
  1417. data/ext/couchbase/third_party/asio/asio/include/asio/posix/basic_descriptor.hpp +74 -13
  1418. data/ext/couchbase/third_party/asio/asio/include/asio/posix/basic_stream_descriptor.hpp +95 -27
  1419. data/ext/couchbase/third_party/asio/asio/include/asio/posix/descriptor.hpp +1 -1
  1420. data/ext/couchbase/third_party/asio/asio/include/asio/posix/descriptor_base.hpp +1 -1
  1421. data/ext/couchbase/third_party/asio/asio/include/asio/posix/stream_descriptor.hpp +1 -1
  1422. data/ext/couchbase/third_party/asio/asio/include/asio/post.hpp +128 -42
  1423. data/ext/couchbase/third_party/asio/asio/include/asio/prefer.hpp +1 -1
  1424. data/ext/couchbase/third_party/asio/asio/include/asio/prepend.hpp +78 -0
  1425. data/ext/couchbase/third_party/asio/asio/include/asio/query.hpp +1 -1
  1426. data/ext/couchbase/third_party/asio/asio/include/asio/random_access_file.hpp +1 -1
  1427. data/ext/couchbase/third_party/asio/asio/include/asio/read.hpp +245 -153
  1428. data/ext/couchbase/third_party/asio/asio/include/asio/read_at.hpp +110 -53
  1429. data/ext/couchbase/third_party/asio/asio/include/asio/read_until.hpp +301 -166
  1430. data/ext/couchbase/third_party/asio/asio/include/asio/readable_pipe.hpp +1 -1
  1431. data/ext/couchbase/third_party/asio/asio/include/asio/recycling_allocator.hpp +138 -0
  1432. data/ext/couchbase/third_party/asio/asio/include/asio/redirect_error.hpp +3 -3
  1433. data/ext/couchbase/third_party/asio/asio/include/asio/registered_buffer.hpp +1 -1
  1434. data/ext/couchbase/third_party/asio/asio/include/asio/require.hpp +1 -1
  1435. data/ext/couchbase/third_party/asio/asio/include/asio/require_concept.hpp +1 -1
  1436. data/ext/couchbase/third_party/asio/asio/include/asio/serial_port.hpp +1 -1
  1437. data/ext/couchbase/third_party/asio/asio/include/asio/serial_port_base.hpp +1 -1
  1438. data/ext/couchbase/third_party/asio/asio/include/asio/signal_set.hpp +1 -1
  1439. data/ext/couchbase/third_party/asio/asio/include/asio/socket_base.hpp +1 -1
  1440. data/ext/couchbase/third_party/asio/asio/include/asio/spawn.hpp +647 -87
  1441. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/context.hpp +4 -1
  1442. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/context_base.hpp +1 -1
  1443. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/buffered_handshake_op.hpp +1 -1
  1444. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/engine.hpp +4 -1
  1445. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/handshake_op.hpp +1 -1
  1446. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/impl/engine.ipp +19 -1
  1447. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/impl/openssl_init.ipp +7 -3
  1448. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/io.hpp +1 -1
  1449. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/openssl_init.hpp +1 -1
  1450. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/openssl_types.hpp +1 -1
  1451. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/password_callback.hpp +1 -1
  1452. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/read_op.hpp +1 -1
  1453. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/shutdown_op.hpp +1 -1
  1454. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/stream_core.hpp +16 -1
  1455. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/verify_callback.hpp +1 -1
  1456. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/detail/write_op.hpp +1 -1
  1457. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/error.hpp +1 -1
  1458. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/host_name_verification.hpp +1 -1
  1459. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/context.hpp +1 -1
  1460. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/context.ipp +140 -64
  1461. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/error.ipp +25 -3
  1462. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/host_name_verification.ipp +1 -1
  1463. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/rfc2818_verification.ipp +1 -1
  1464. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/impl/src.hpp +1 -1
  1465. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/rfc2818_verification.hpp +1 -1
  1466. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/stream.hpp +154 -53
  1467. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/stream_base.hpp +1 -1
  1468. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/verify_context.hpp +1 -1
  1469. data/ext/couchbase/third_party/asio/asio/include/asio/ssl/verify_mode.hpp +1 -1
  1470. data/ext/couchbase/third_party/asio/asio/include/asio/ssl.hpp +1 -1
  1471. data/ext/couchbase/third_party/asio/asio/include/asio/static_thread_pool.hpp +1 -1
  1472. data/ext/couchbase/third_party/asio/asio/include/asio/steady_timer.hpp +1 -1
  1473. data/ext/couchbase/third_party/asio/asio/include/asio/strand.hpp +12 -1
  1474. data/ext/couchbase/third_party/asio/asio/include/asio/stream_file.hpp +1 -1
  1475. data/ext/couchbase/third_party/asio/asio/include/asio/streambuf.hpp +1 -1
  1476. data/ext/couchbase/third_party/asio/asio/include/asio/system_context.hpp +1 -1
  1477. data/ext/couchbase/third_party/asio/asio/include/asio/system_error.hpp +1 -1
  1478. data/ext/couchbase/third_party/asio/asio/include/asio/system_executor.hpp +1 -1
  1479. data/ext/couchbase/third_party/asio/asio/include/asio/system_timer.hpp +1 -1
  1480. data/ext/couchbase/third_party/asio/asio/include/asio/this_coro.hpp +4 -4
  1481. data/ext/couchbase/third_party/asio/asio/include/asio/thread.hpp +1 -1
  1482. data/ext/couchbase/third_party/asio/asio/include/asio/thread_pool.hpp +1 -1
  1483. data/ext/couchbase/third_party/asio/asio/include/asio/time_traits.hpp +1 -1
  1484. data/ext/couchbase/third_party/asio/asio/include/asio/traits/bulk_execute_free.hpp +1 -1
  1485. data/ext/couchbase/third_party/asio/asio/include/asio/traits/bulk_execute_member.hpp +1 -1
  1486. data/ext/couchbase/third_party/asio/asio/include/asio/traits/connect_free.hpp +1 -1
  1487. data/ext/couchbase/third_party/asio/asio/include/asio/traits/connect_member.hpp +1 -1
  1488. data/ext/couchbase/third_party/asio/asio/include/asio/traits/equality_comparable.hpp +1 -1
  1489. data/ext/couchbase/third_party/asio/asio/include/asio/traits/execute_free.hpp +1 -1
  1490. data/ext/couchbase/third_party/asio/asio/include/asio/traits/execute_member.hpp +1 -1
  1491. data/ext/couchbase/third_party/asio/asio/include/asio/traits/prefer_free.hpp +1 -1
  1492. data/ext/couchbase/third_party/asio/asio/include/asio/traits/prefer_member.hpp +1 -1
  1493. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_free.hpp +1 -1
  1494. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_member.hpp +1 -1
  1495. data/ext/couchbase/third_party/asio/asio/include/asio/traits/query_static_constexpr_member.hpp +1 -1
  1496. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_concept_free.hpp +1 -1
  1497. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_concept_member.hpp +1 -1
  1498. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_free.hpp +1 -1
  1499. data/ext/couchbase/third_party/asio/asio/include/asio/traits/require_member.hpp +1 -1
  1500. data/ext/couchbase/third_party/asio/asio/include/asio/traits/schedule_free.hpp +1 -1
  1501. data/ext/couchbase/third_party/asio/asio/include/asio/traits/schedule_member.hpp +1 -1
  1502. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_done_free.hpp +1 -1
  1503. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_done_member.hpp +1 -1
  1504. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_error_free.hpp +1 -1
  1505. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_error_member.hpp +1 -1
  1506. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_value_free.hpp +1 -1
  1507. data/ext/couchbase/third_party/asio/asio/include/asio/traits/set_value_member.hpp +1 -1
  1508. data/ext/couchbase/third_party/asio/asio/include/asio/traits/start_free.hpp +1 -1
  1509. data/ext/couchbase/third_party/asio/asio/include/asio/traits/start_member.hpp +1 -1
  1510. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_query.hpp +1 -1
  1511. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_require.hpp +1 -1
  1512. data/ext/couchbase/third_party/asio/asio/include/asio/traits/static_require_concept.hpp +1 -1
  1513. data/ext/couchbase/third_party/asio/asio/include/asio/traits/submit_free.hpp +1 -1
  1514. data/ext/couchbase/third_party/asio/asio/include/asio/traits/submit_member.hpp +1 -1
  1515. data/ext/couchbase/third_party/asio/asio/include/asio/ts/buffer.hpp +1 -1
  1516. data/ext/couchbase/third_party/asio/asio/include/asio/ts/executor.hpp +1 -1
  1517. data/ext/couchbase/third_party/asio/asio/include/asio/ts/internet.hpp +1 -1
  1518. data/ext/couchbase/third_party/asio/asio/include/asio/ts/io_context.hpp +1 -1
  1519. data/ext/couchbase/third_party/asio/asio/include/asio/ts/net.hpp +1 -1
  1520. data/ext/couchbase/third_party/asio/asio/include/asio/ts/netfwd.hpp +1 -1
  1521. data/ext/couchbase/third_party/asio/asio/include/asio/ts/socket.hpp +1 -1
  1522. data/ext/couchbase/third_party/asio/asio/include/asio/ts/timer.hpp +1 -1
  1523. data/ext/couchbase/third_party/asio/asio/include/asio/unyield.hpp +1 -1
  1524. data/ext/couchbase/third_party/asio/asio/include/asio/use_awaitable.hpp +4 -3
  1525. data/ext/couchbase/third_party/asio/asio/include/asio/use_future.hpp +10 -7
  1526. data/ext/couchbase/third_party/asio/asio/include/asio/uses_executor.hpp +1 -1
  1527. data/ext/couchbase/third_party/asio/asio/include/asio/version.hpp +2 -2
  1528. data/ext/couchbase/third_party/asio/asio/include/asio/wait_traits.hpp +1 -1
  1529. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_object_handle.hpp +70 -12
  1530. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_overlapped_handle.hpp +100 -1
  1531. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_random_access_handle.hpp +98 -29
  1532. data/ext/couchbase/third_party/asio/asio/include/asio/windows/basic_stream_handle.hpp +95 -28
  1533. data/ext/couchbase/third_party/asio/asio/include/asio/windows/object_handle.hpp +1 -1
  1534. data/ext/couchbase/third_party/asio/asio/include/asio/windows/overlapped_handle.hpp +1 -1
  1535. data/ext/couchbase/third_party/asio/asio/include/asio/windows/overlapped_ptr.hpp +1 -1
  1536. data/ext/couchbase/third_party/asio/asio/include/asio/windows/random_access_handle.hpp +1 -1
  1537. data/ext/couchbase/third_party/asio/asio/include/asio/windows/stream_handle.hpp +1 -1
  1538. data/ext/couchbase/third_party/asio/asio/include/asio/writable_pipe.hpp +1 -1
  1539. data/ext/couchbase/third_party/asio/asio/include/asio/write.hpp +242 -150
  1540. data/ext/couchbase/third_party/asio/asio/include/asio/write_at.hpp +112 -53
  1541. data/ext/couchbase/third_party/asio/asio/include/asio/yield.hpp +1 -1
  1542. data/ext/couchbase/third_party/asio/asio/include/asio.hpp +8 -1
  1543. data/ext/couchbase/third_party/expected/COPYING +121 -0
  1544. data/ext/couchbase/third_party/expected/include/tl/expected.hpp +2571 -0
  1545. data/ext/couchbase/third_party/json/CMakeLists.txt +3 -0
  1546. data/ext/couchbase/third_party/json/external/PEGTL/LICENSE +1 -1
  1547. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/apply_mode.hpp +1 -1
  1548. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/argv_input.hpp +1 -1
  1549. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/ascii.hpp +1 -1
  1550. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/buffer_input.hpp +2 -2
  1551. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action.hpp +1 -1
  1552. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action_and_state.hpp +1 -1
  1553. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_action_and_states.hpp +1 -1
  1554. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_control.hpp +1 -1
  1555. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_state.hpp +1 -1
  1556. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/change_states.hpp +1 -1
  1557. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/config.hpp +1 -1
  1558. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/abnf.hpp +1 -1
  1559. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/add_state.hpp +1 -1
  1560. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/alphabet.hpp +1 -1
  1561. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/analyze.hpp +1 -1
  1562. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/analyze_traits.hpp +1 -1
  1563. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/check_bytes.hpp +1 -1
  1564. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/control_action.hpp +13 -1
  1565. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/coverage.hpp +1 -1
  1566. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/forward.hpp +1 -1
  1567. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/function.hpp +1 -1
  1568. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/http.hpp +1 -1
  1569. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp +1 -1
  1570. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp +1 -1
  1571. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp +1 -1
  1572. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp +1 -1
  1573. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/if_then.hpp +1 -1
  1574. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/instantiate.hpp +1 -1
  1575. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/integer.hpp +1 -1
  1576. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian.hpp +1 -1
  1577. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian_gcc.hpp +1 -1
  1578. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/endian_win.hpp +1 -1
  1579. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_mask_uint.hpp +1 -1
  1580. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_mask_uint8.hpp +1 -1
  1581. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_uint.hpp +1 -1
  1582. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_uint8.hpp +1 -1
  1583. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_utf16.hpp +1 -1
  1584. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/peek_utf32.hpp +1 -1
  1585. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/read_uint.hpp +1 -1
  1586. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/set_stack_guard.hpp +1 -1
  1587. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/internal/vector_stack_guard.hpp +1 -1
  1588. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/iri.hpp +1 -1
  1589. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/json.hpp +1 -1
  1590. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/json_pointer.hpp +1 -1
  1591. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/limit_bytes.hpp +1 -1
  1592. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/limit_depth.hpp +1 -1
  1593. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp +17 -8
  1594. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/parse_tree_to_dot.hpp +1 -1
  1595. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/peg.hpp +1 -1
  1596. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/predicates.hpp +1 -1
  1597. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/print.hpp +1 -1
  1598. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/print_coverage.hpp +1 -1
  1599. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/proto3.hpp +1 -1
  1600. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/raw_string.hpp +1 -1
  1601. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/remove_first_state.hpp +1 -1
  1602. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/remove_last_states.hpp +1 -1
  1603. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp +1 -1
  1604. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/rep_string.hpp +1 -1
  1605. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/separated_seq.hpp +1 -1
  1606. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/shuffle_states.hpp +1 -1
  1607. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/state_control.hpp +1 -1
  1608. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/to_string.hpp +1 -1
  1609. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/trace.hpp +1 -1
  1610. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint16.hpp +1 -1
  1611. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint32.hpp +1 -1
  1612. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint64.hpp +1 -1
  1613. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uint8.hpp +1 -1
  1614. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/unescape.hpp +1 -1
  1615. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/uri.hpp +1 -1
  1616. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/utf16.hpp +1 -1
  1617. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/contrib/utf32.hpp +1 -1
  1618. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/cstream_input.hpp +1 -1
  1619. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/demangle.hpp +19 -11
  1620. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/disable_action.hpp +1 -1
  1621. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input.hpp +1 -1
  1622. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input_on_failure.hpp +1 -1
  1623. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/discard_input_on_success.hpp +1 -1
  1624. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/enable_action.hpp +1 -1
  1625. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/eol.hpp +1 -1
  1626. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/eol_pair.hpp +1 -1
  1627. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/file_input.hpp +1 -1
  1628. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/action.hpp +1 -1
  1629. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/action_input.hpp +1 -1
  1630. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/any.hpp +1 -1
  1631. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply.hpp +1 -1
  1632. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply0.hpp +1 -1
  1633. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply0_single.hpp +1 -1
  1634. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/apply_single.hpp +1 -1
  1635. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/at.hpp +1 -1
  1636. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bof.hpp +1 -1
  1637. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bol.hpp +1 -1
  1638. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump.hpp +1 -1
  1639. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bump_help.hpp +1 -1
  1640. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/bytes.hpp +1 -1
  1641. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/control.hpp +1 -1
  1642. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp +1 -1
  1643. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cr_eol.hpp +1 -1
  1644. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp +1 -1
  1645. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp +1 -1
  1646. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp +1 -1
  1647. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/dependent_false.hpp +1 -1
  1648. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/disable.hpp +1 -1
  1649. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/discard.hpp +1 -1
  1650. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/enable.hpp +1 -1
  1651. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/enable_control.hpp +1 -1
  1652. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eof.hpp +1 -1
  1653. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eol.hpp +1 -1
  1654. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/eolf.hpp +1 -1
  1655. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/failure.hpp +1 -1
  1656. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp +1 -1
  1657. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp +1 -1
  1658. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/file_reader.hpp +1 -1
  1659. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/filesystem.hpp +1 -1
  1660. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_apply.hpp +1 -1
  1661. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_apply0.hpp +1 -1
  1662. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_match.hpp +1 -1
  1663. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/has_unwind.hpp +1 -1
  1664. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/identifier.hpp +1 -1
  1665. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_apply.hpp +1 -1
  1666. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_must.hpp +1 -1
  1667. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_must_else.hpp +1 -1
  1668. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/if_then_else.hpp +1 -1
  1669. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/input_pair.hpp +1 -1
  1670. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/istream_reader.hpp +1 -1
  1671. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/istring.hpp +1 -1
  1672. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/iterator.hpp +1 -1
  1673. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp +1 -1
  1674. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/lf_eol.hpp +1 -1
  1675. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list.hpp +1 -1
  1676. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_must.hpp +1 -1
  1677. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_tail.hpp +1 -1
  1678. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp +1 -1
  1679. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/marker.hpp +1 -1
  1680. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/minus.hpp +1 -1
  1681. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/missing_apply.hpp +1 -1
  1682. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/missing_apply0.hpp +1 -1
  1683. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/must.hpp +1 -1
  1684. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/not_at.hpp +1 -1
  1685. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/one.hpp +1 -1
  1686. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/opt.hpp +1 -1
  1687. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pad.hpp +1 -1
  1688. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pad_opt.hpp +1 -1
  1689. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/path_to_string.hpp +1 -1
  1690. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/peek_char.hpp +1 -1
  1691. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp +1 -1
  1692. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp +1 -1
  1693. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/plus.hpp +1 -1
  1694. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/raise.hpp +1 -1
  1695. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/range.hpp +1 -1
  1696. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/ranges.hpp +1 -1
  1697. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rematch.hpp +1 -1
  1698. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep.hpp +1 -1
  1699. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_min.hpp +1 -1
  1700. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp +1 -1
  1701. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rep_opt.hpp +1 -1
  1702. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/require.hpp +1 -1
  1703. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/result_on_found.hpp +1 -1
  1704. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/rules.hpp +1 -1
  1705. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/seq.hpp +1 -1
  1706. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/sor.hpp +1 -1
  1707. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/star.hpp +1 -1
  1708. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/star_must.hpp +1 -1
  1709. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/state.hpp +1 -1
  1710. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/string.hpp +1 -1
  1711. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/success.hpp +1 -1
  1712. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp +1 -1
  1713. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/until.hpp +1 -1
  1714. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/istream_input.hpp +1 -1
  1715. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/match.hpp +1 -1
  1716. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/memory_input.hpp +1 -1
  1717. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/mmap_input.hpp +1 -1
  1718. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/must_if.hpp +1 -1
  1719. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/normal.hpp +1 -1
  1720. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/nothing.hpp +1 -1
  1721. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/parse.hpp +1 -1
  1722. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/parse_error.hpp +1 -1
  1723. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/position.hpp +1 -1
  1724. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/read_input.hpp +1 -1
  1725. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/require_apply.hpp +1 -1
  1726. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/require_apply0.hpp +1 -1
  1727. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/rewind_mode.hpp +1 -1
  1728. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/rules.hpp +1 -1
  1729. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/string_input.hpp +1 -1
  1730. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/tracking_mode.hpp +1 -1
  1731. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/type_list.hpp +1 -1
  1732. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/utf8.hpp +1 -1
  1733. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/version.hpp +2 -2
  1734. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/visit.hpp +1 -1
  1735. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl.hpp +1 -1
  1736. data/ext/couchbase/third_party/json/include/tao/json/binary_view.hpp +14 -0
  1737. data/ext/couchbase/third_party/json/include/tao/json/contrib/from_nlohmann.hpp +67 -0
  1738. data/ext/couchbase/third_party/json/include/tao/json/contrib/to_nlohmann.hpp +122 -0
  1739. data/ext/couchbase/third_party/json/include/tao/json/events/capture.hpp +482 -0
  1740. data/ext/couchbase/third_party/json/include/tao/json/events/from_value.hpp +3 -3
  1741. data/ext/couchbase/third_party/json/include/tao/json/events/produce.hpp +3 -95
  1742. data/ext/couchbase/third_party/json/include/tao/json/events/set_value.hpp +142 -0
  1743. data/ext/couchbase/third_party/json/include/tao/json/events/to_value.hpp +5 -112
  1744. data/ext/couchbase/third_party/json/include/tao/json/events/virtualize.hpp +27 -0
  1745. data/ext/couchbase/third_party/json/include/tao/json/events.hpp +3 -0
  1746. data/ext/couchbase/third_party/json/include/tao/json/traits.hpp +1 -1
  1747. data/ext/couchbase.cxx +2882 -1629
  1748. data/ext/extconf.rb +4 -1
  1749. data/ext/revisions.rb +3 -2
  1750. data/lib/couchbase/binary_collection.rb +4 -4
  1751. data/lib/couchbase/bucket.rb +2 -2
  1752. data/lib/couchbase/cluster.rb +12 -6
  1753. data/lib/couchbase/cluster_registry.rb +44 -0
  1754. data/lib/couchbase/collection.rb +66 -35
  1755. data/lib/couchbase/collection_options.rb +51 -95
  1756. data/lib/couchbase/config_profiles.rb +55 -0
  1757. data/lib/couchbase/errors.rb +10 -0
  1758. data/lib/couchbase/logger.rb +44 -1
  1759. data/lib/couchbase/management/analytics_index_manager.rb +12 -12
  1760. data/lib/couchbase/management/collection_query_index_manager.rb +183 -0
  1761. data/lib/couchbase/management/query_index_manager.rb +39 -9
  1762. data/lib/couchbase/management/user_manager.rb +19 -0
  1763. data/lib/couchbase/management.rb +1 -0
  1764. data/lib/couchbase/options.rb +406 -59
  1765. data/lib/couchbase/query_options.rb +4 -4
  1766. data/lib/couchbase/scope.rb +3 -3
  1767. data/lib/couchbase/search_options.rb +7 -8
  1768. data/lib/couchbase/utils/generic_logger_adapter.rb +38 -0
  1769. data/lib/couchbase/utils/stdlib_logger_adapter.rb +65 -0
  1770. data/lib/couchbase/utils/time.rb +6 -6
  1771. data/lib/couchbase/version.rb +4 -18
  1772. metadata +884 -464
  1773. data/ext/couchbase/couchbase/analytics_scan_consistency.hxx +0 -26
  1774. data/ext/couchbase/couchbase/capella_ca.hxx +0 -43
  1775. data/ext/couchbase/couchbase/cas_fmt.hxx +0 -37
  1776. data/ext/couchbase/couchbase/cluster.cxx +0 -111
  1777. data/ext/couchbase/couchbase/cluster_options.cxx +0 -45
  1778. data/ext/couchbase/couchbase/crypto/CMakeLists.txt +0 -12
  1779. data/ext/couchbase/couchbase/crypto/cbcrypto.cc +0 -887
  1780. data/ext/couchbase/couchbase/crypto/cbcrypto.h +0 -88
  1781. data/ext/couchbase/couchbase/design_document_namespace.hxx +0 -26
  1782. data/ext/couchbase/couchbase/design_document_namespace_fmt.hxx +0 -47
  1783. data/ext/couchbase/couchbase/diagnostics.hxx +0 -97
  1784. data/ext/couchbase/couchbase/diagnostics_fmt.hxx +0 -113
  1785. data/ext/couchbase/couchbase/diagnostics_json.hxx +0 -100
  1786. data/ext/couchbase/couchbase/document_id.cxx +0 -89
  1787. data/ext/couchbase/couchbase/document_id.hxx +0 -102
  1788. data/ext/couchbase/couchbase/document_id_fmt.hxx +0 -37
  1789. data/ext/couchbase/couchbase/error_context/analytics.hxx +0 -51
  1790. data/ext/couchbase/couchbase/error_context/http.hxx +0 -47
  1791. data/ext/couchbase/couchbase/error_context/key_value.hxx +0 -50
  1792. data/ext/couchbase/couchbase/error_context/query.hxx +0 -51
  1793. data/ext/couchbase/couchbase/error_context/search.hxx +0 -50
  1794. data/ext/couchbase/couchbase/error_context/view.hxx +0 -51
  1795. data/ext/couchbase/couchbase/errors.hxx +0 -1038
  1796. data/ext/couchbase/couchbase/io/CMakeLists.txt +0 -12
  1797. data/ext/couchbase/couchbase/io/dns_client.hxx +0 -217
  1798. data/ext/couchbase/couchbase/io/dns_codec.hxx +0 -206
  1799. data/ext/couchbase/couchbase/io/dns_config.hxx +0 -115
  1800. data/ext/couchbase/couchbase/io/dns_message.hxx +0 -555
  1801. data/ext/couchbase/couchbase/io/http_command.hxx +0 -174
  1802. data/ext/couchbase/couchbase/io/http_context.hxx +0 -40
  1803. data/ext/couchbase/couchbase/io/http_message.hxx +0 -116
  1804. data/ext/couchbase/couchbase/io/http_parser.cxx +0 -141
  1805. data/ext/couchbase/couchbase/io/http_parser.hxx +0 -55
  1806. data/ext/couchbase/couchbase/io/http_session.hxx +0 -544
  1807. data/ext/couchbase/couchbase/io/http_session_manager.hxx +0 -377
  1808. data/ext/couchbase/couchbase/io/http_traits.hxx +0 -30
  1809. data/ext/couchbase/couchbase/io/ip_protocol.hxx +0 -28
  1810. data/ext/couchbase/couchbase/io/mcbp_command.hxx +0 -300
  1811. data/ext/couchbase/couchbase/io/mcbp_context.hxx +0 -39
  1812. data/ext/couchbase/couchbase/io/mcbp_message.cxx +0 -39
  1813. data/ext/couchbase/couchbase/io/mcbp_message.hxx +0 -55
  1814. data/ext/couchbase/couchbase/io/mcbp_parser.cxx +0 -86
  1815. data/ext/couchbase/couchbase/io/mcbp_parser.hxx +0 -45
  1816. data/ext/couchbase/couchbase/io/mcbp_session.hxx +0 -1317
  1817. data/ext/couchbase/couchbase/io/mcbp_traits.hxx +0 -30
  1818. data/ext/couchbase/couchbase/io/query_cache.hxx +0 -61
  1819. data/ext/couchbase/couchbase/io/retry_action.hxx +0 -30
  1820. data/ext/couchbase/couchbase/io/retry_context.hxx +0 -38
  1821. data/ext/couchbase/couchbase/io/retry_orchestrator.hxx +0 -112
  1822. data/ext/couchbase/couchbase/io/retry_reason.hxx +0 -158
  1823. data/ext/couchbase/couchbase/io/retry_reason_fmt.hxx +0 -103
  1824. data/ext/couchbase/couchbase/io/retry_strategy.hxx +0 -152
  1825. data/ext/couchbase/couchbase/io/streams.hxx +0 -253
  1826. data/ext/couchbase/couchbase/json_string.hxx +0 -48
  1827. data/ext/couchbase/couchbase/logger/CMakeLists.txt +0 -9
  1828. data/ext/couchbase/couchbase/logger/configuration.hxx +0 -52
  1829. data/ext/couchbase/couchbase/logger/custom_rotating_file_sink.cxx +0 -157
  1830. data/ext/couchbase/couchbase/logger/logger.cxx +0 -337
  1831. data/ext/couchbase/couchbase/logger/logger.hxx +0 -235
  1832. data/ext/couchbase/couchbase/management/CMakeLists.txt +0 -13
  1833. data/ext/couchbase/couchbase/management/analytics_dataset.hxx +0 -30
  1834. data/ext/couchbase/couchbase/management/analytics_index.hxx +0 -30
  1835. data/ext/couchbase/couchbase/management/analytics_link.hxx +0 -22
  1836. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external.cxx +0 -67
  1837. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external.hxx +0 -76
  1838. data/ext/couchbase/couchbase/management/analytics_link_azure_blob_external_json.hxx +0 -52
  1839. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote.cxx +0 -104
  1840. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote.hxx +0 -107
  1841. data/ext/couchbase/couchbase/management/analytics_link_couchbase_remote_json.hxx +0 -63
  1842. data/ext/couchbase/couchbase/management/analytics_link_s3_external.cxx +0 -57
  1843. data/ext/couchbase/couchbase/management/analytics_link_s3_external.hxx +0 -69
  1844. data/ext/couchbase/couchbase/management/analytics_link_s3_external_json.hxx +0 -47
  1845. data/ext/couchbase/couchbase/management/bucket_settings.hxx +0 -134
  1846. data/ext/couchbase/couchbase/management/bucket_settings_json.hxx +0 -123
  1847. data/ext/couchbase/couchbase/management/design_document.hxx +0 -41
  1848. data/ext/couchbase/couchbase/management/eventing_function.hxx +0 -188
  1849. data/ext/couchbase/couchbase/management/eventing_function_json.hxx +0 -212
  1850. data/ext/couchbase/couchbase/management/eventing_status.hxx +0 -84
  1851. data/ext/couchbase/couchbase/management/eventing_status_json.hxx +0 -77
  1852. data/ext/couchbase/couchbase/management/rbac.hxx +0 -77
  1853. data/ext/couchbase/couchbase/management/rbac_fmt.hxx +0 -49
  1854. data/ext/couchbase/couchbase/management/rbac_json.hxx +0 -179
  1855. data/ext/couchbase/couchbase/management/search_index.hxx +0 -38
  1856. data/ext/couchbase/couchbase/management/search_index_json.hxx +0 -58
  1857. data/ext/couchbase/couchbase/meta/CMakeLists.txt +0 -15
  1858. data/ext/couchbase/couchbase/meta/version.cxx +0 -181
  1859. data/ext/couchbase/couchbase/meta/version.hxx +0 -45
  1860. data/ext/couchbase/couchbase/metrics/CMakeLists.txt +0 -11
  1861. data/ext/couchbase/couchbase/metrics/logging_meter.cxx +0 -194
  1862. data/ext/couchbase/couchbase/metrics/logging_meter.hxx +0 -74
  1863. data/ext/couchbase/couchbase/metrics/logging_meter_options.hxx +0 -28
  1864. data/ext/couchbase/couchbase/metrics/noop_meter.hxx +0 -47
  1865. data/ext/couchbase/couchbase/mutation_token_fmt.hxx +0 -37
  1866. data/ext/couchbase/couchbase/operations/CMakeLists.txt +0 -35
  1867. data/ext/couchbase/couchbase/operations/document_analytics.cxx +0 -195
  1868. data/ext/couchbase/couchbase/operations/document_analytics.hxx +0 -92
  1869. data/ext/couchbase/couchbase/operations/document_append.cxx +0 -46
  1870. data/ext/couchbase/couchbase/operations/document_append.hxx +0 -63
  1871. data/ext/couchbase/couchbase/operations/document_decrement.cxx +0 -57
  1872. data/ext/couchbase/couchbase/operations/document_decrement.hxx +0 -67
  1873. data/ext/couchbase/couchbase/operations/document_exists.cxx +0 -49
  1874. data/ext/couchbase/couchbase/operations/document_exists.hxx +0 -61
  1875. data/ext/couchbase/couchbase/operations/document_get.cxx +0 -44
  1876. data/ext/couchbase/couchbase/operations/document_get.hxx +0 -53
  1877. data/ext/couchbase/couchbase/operations/document_get_and_lock.cxx +0 -45
  1878. data/ext/couchbase/couchbase/operations/document_get_and_lock.hxx +0 -54
  1879. data/ext/couchbase/couchbase/operations/document_get_and_touch.cxx +0 -45
  1880. data/ext/couchbase/couchbase/operations/document_get_and_touch.hxx +0 -54
  1881. data/ext/couchbase/couchbase/operations/document_get_projected.cxx +0 -227
  1882. data/ext/couchbase/couchbase/operations/document_get_projected.hxx +0 -58
  1883. data/ext/couchbase/couchbase/operations/document_increment.cxx +0 -57
  1884. data/ext/couchbase/couchbase/operations/document_increment.hxx +0 -67
  1885. data/ext/couchbase/couchbase/operations/document_insert.cxx +0 -48
  1886. data/ext/couchbase/couchbase/operations/document_insert.hxx +0 -65
  1887. data/ext/couchbase/couchbase/operations/document_lookup_in.cxx +0 -81
  1888. data/ext/couchbase/couchbase/operations/document_lookup_in.hxx +0 -64
  1889. data/ext/couchbase/couchbase/operations/document_mutate_in.cxx +0 -104
  1890. data/ext/couchbase/couchbase/operations/document_mutate_in.hxx +0 -82
  1891. data/ext/couchbase/couchbase/operations/document_prepend.cxx +0 -46
  1892. data/ext/couchbase/couchbase/operations/document_prepend.hxx +0 -63
  1893. data/ext/couchbase/couchbase/operations/document_query.cxx +0 -370
  1894. data/ext/couchbase/couchbase/operations/document_query.hxx +0 -123
  1895. data/ext/couchbase/couchbase/operations/document_remove.cxx +0 -46
  1896. data/ext/couchbase/couchbase/operations/document_remove.hxx +0 -63
  1897. data/ext/couchbase/couchbase/operations/document_replace.cxx +0 -52
  1898. data/ext/couchbase/couchbase/operations/document_replace.hxx +0 -67
  1899. data/ext/couchbase/couchbase/operations/document_search.cxx +0 -311
  1900. data/ext/couchbase/couchbase/operations/document_search.hxx +0 -153
  1901. data/ext/couchbase/couchbase/operations/document_touch.cxx +0 -43
  1902. data/ext/couchbase/couchbase/operations/document_touch.hxx +0 -52
  1903. data/ext/couchbase/couchbase/operations/document_unlock.cxx +0 -43
  1904. data/ext/couchbase/couchbase/operations/document_unlock.hxx +0 -52
  1905. data/ext/couchbase/couchbase/operations/document_upsert.cxx +0 -52
  1906. data/ext/couchbase/couchbase/operations/document_upsert.hxx +0 -66
  1907. data/ext/couchbase/couchbase/operations/document_view.cxx +0 -183
  1908. data/ext/couchbase/couchbase/operations/document_view.hxx +0 -97
  1909. data/ext/couchbase/couchbase/operations/http_noop.cxx +0 -60
  1910. data/ext/couchbase/couchbase/operations/http_noop.hxx +0 -48
  1911. data/ext/couchbase/couchbase/operations/management/CMakeLists.txt +0 -79
  1912. data/ext/couchbase/couchbase/operations/management/analytics.hxx +0 -34
  1913. data/ext/couchbase/couchbase/operations/management/analytics_dataset_create.cxx +0 -94
  1914. data/ext/couchbase/couchbase/operations/management/analytics_dataset_create.hxx +0 -57
  1915. data/ext/couchbase/couchbase/operations/management/analytics_dataset_drop.cxx +0 -83
  1916. data/ext/couchbase/couchbase/operations/management/analytics_dataset_drop.hxx +0 -54
  1917. data/ext/couchbase/couchbase/operations/management/analytics_dataset_get_all.cxx +0 -80
  1918. data/ext/couchbase/couchbase/operations/management/analytics_dataset_get_all.hxx +0 -52
  1919. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_create.cxx +0 -82
  1920. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_create.hxx +0 -53
  1921. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_drop.cxx +0 -82
  1922. data/ext/couchbase/couchbase/operations/management/analytics_dataverse_drop.hxx +0 -53
  1923. data/ext/couchbase/couchbase/operations/management/analytics_get_pending_mutations.cxx +0 -70
  1924. data/ext/couchbase/couchbase/operations/management/analytics_get_pending_mutations.hxx +0 -52
  1925. data/ext/couchbase/couchbase/operations/management/analytics_index_create.cxx +0 -106
  1926. data/ext/couchbase/couchbase/operations/management/analytics_index_create.hxx +0 -56
  1927. data/ext/couchbase/couchbase/operations/management/analytics_index_drop.cxx +0 -90
  1928. data/ext/couchbase/couchbase/operations/management/analytics_index_drop.hxx +0 -55
  1929. data/ext/couchbase/couchbase/operations/management/analytics_index_get_all.cxx +0 -80
  1930. data/ext/couchbase/couchbase/operations/management/analytics_index_get_all.hxx +0 -52
  1931. data/ext/couchbase/couchbase/operations/management/analytics_link_connect.cxx +0 -82
  1932. data/ext/couchbase/couchbase/operations/management/analytics_link_connect.hxx +0 -57
  1933. data/ext/couchbase/couchbase/operations/management/analytics_link_create.cxx +0 -87
  1934. data/ext/couchbase/couchbase/operations/management/analytics_link_create.hxx +0 -77
  1935. data/ext/couchbase/couchbase/operations/management/analytics_link_disconnect.cxx +0 -80
  1936. data/ext/couchbase/couchbase/operations/management/analytics_link_disconnect.hxx +0 -56
  1937. data/ext/couchbase/couchbase/operations/management/analytics_link_drop.cxx +0 -103
  1938. data/ext/couchbase/couchbase/operations/management/analytics_link_drop.hxx +0 -56
  1939. data/ext/couchbase/couchbase/operations/management/analytics_link_get_all.cxx +0 -130
  1940. data/ext/couchbase/couchbase/operations/management/analytics_link_get_all.hxx +0 -63
  1941. data/ext/couchbase/couchbase/operations/management/analytics_link_replace.cxx +0 -87
  1942. data/ext/couchbase/couchbase/operations/management/analytics_link_replace.hxx +0 -78
  1943. data/ext/couchbase/couchbase/operations/management/analytics_link_utils.hxx +0 -37
  1944. data/ext/couchbase/couchbase/operations/management/analytics_problem.hxx +0 -30
  1945. data/ext/couchbase/couchbase/operations/management/bucket.hxx +0 -25
  1946. data/ext/couchbase/couchbase/operations/management/bucket_create.cxx +0 -171
  1947. data/ext/couchbase/couchbase/operations/management/bucket_create.hxx +0 -52
  1948. data/ext/couchbase/couchbase/operations/management/bucket_describe.cxx +0 -67
  1949. data/ext/couchbase/couchbase/operations/management/bucket_describe.hxx +0 -61
  1950. data/ext/couchbase/couchbase/operations/management/bucket_drop.cxx +0 -52
  1951. data/ext/couchbase/couchbase/operations/management/bucket_drop.hxx +0 -49
  1952. data/ext/couchbase/couchbase/operations/management/bucket_flush.cxx +0 -59
  1953. data/ext/couchbase/couchbase/operations/management/bucket_flush.hxx +0 -49
  1954. data/ext/couchbase/couchbase/operations/management/bucket_get.cxx +0 -59
  1955. data/ext/couchbase/couchbase/operations/management/bucket_get.hxx +0 -51
  1956. data/ext/couchbase/couchbase/operations/management/bucket_get_all.cxx +0 -59
  1957. data/ext/couchbase/couchbase/operations/management/bucket_get_all.hxx +0 -49
  1958. data/ext/couchbase/couchbase/operations/management/bucket_update.cxx +0 -130
  1959. data/ext/couchbase/couchbase/operations/management/bucket_update.hxx +0 -52
  1960. data/ext/couchbase/couchbase/operations/management/cluster_describe.cxx +0 -90
  1961. data/ext/couchbase/couchbase/operations/management/cluster_describe.hxx +0 -72
  1962. data/ext/couchbase/couchbase/operations/management/cluster_developer_preview_enable.cxx +0 -44
  1963. data/ext/couchbase/couchbase/operations/management/cluster_developer_preview_enable.hxx +0 -48
  1964. data/ext/couchbase/couchbase/operations/management/collection_create.cxx +0 -83
  1965. data/ext/couchbase/couchbase/operations/management/collection_create.hxx +0 -53
  1966. data/ext/couchbase/couchbase/operations/management/collection_drop.cxx +0 -73
  1967. data/ext/couchbase/couchbase/operations/management/collection_drop.hxx +0 -52
  1968. data/ext/couchbase/couchbase/operations/management/collections.hxx +0 -25
  1969. data/ext/couchbase/couchbase/operations/management/collections_manifest_get.cxx +0 -40
  1970. data/ext/couchbase/couchbase/operations/management/collections_manifest_get.hxx +0 -53
  1971. data/ext/couchbase/couchbase/operations/management/error_utils.cxx +0 -265
  1972. data/ext/couchbase/couchbase/operations/management/error_utils.hxx +0 -48
  1973. data/ext/couchbase/couchbase/operations/management/eventing.hxx +0 -28
  1974. data/ext/couchbase/couchbase/operations/management/eventing_deploy_function.cxx +0 -56
  1975. data/ext/couchbase/couchbase/operations/management/eventing_deploy_function.hxx +0 -52
  1976. data/ext/couchbase/couchbase/operations/management/eventing_drop_function.cxx +0 -57
  1977. data/ext/couchbase/couchbase/operations/management/eventing_drop_function.hxx +0 -52
  1978. data/ext/couchbase/couchbase/operations/management/eventing_get_all_functions.cxx +0 -64
  1979. data/ext/couchbase/couchbase/operations/management/eventing_get_all_functions.hxx +0 -51
  1980. data/ext/couchbase/couchbase/operations/management/eventing_get_function.cxx +0 -56
  1981. data/ext/couchbase/couchbase/operations/management/eventing_get_function.hxx +0 -53
  1982. data/ext/couchbase/couchbase/operations/management/eventing_get_status.cxx +0 -56
  1983. data/ext/couchbase/couchbase/operations/management/eventing_get_status.hxx +0 -53
  1984. data/ext/couchbase/couchbase/operations/management/eventing_pause_function.cxx +0 -56
  1985. data/ext/couchbase/couchbase/operations/management/eventing_pause_function.hxx +0 -52
  1986. data/ext/couchbase/couchbase/operations/management/eventing_problem.hxx +0 -31
  1987. data/ext/couchbase/couchbase/operations/management/eventing_resume_function.cxx +0 -56
  1988. data/ext/couchbase/couchbase/operations/management/eventing_resume_function.hxx +0 -52
  1989. data/ext/couchbase/couchbase/operations/management/eventing_undeploy_function.cxx +0 -56
  1990. data/ext/couchbase/couchbase/operations/management/eventing_undeploy_function.hxx +0 -52
  1991. data/ext/couchbase/couchbase/operations/management/eventing_upsert_function.cxx +0 -341
  1992. data/ext/couchbase/couchbase/operations/management/eventing_upsert_function.hxx +0 -52
  1993. data/ext/couchbase/couchbase/operations/management/freeform.cxx +0 -55
  1994. data/ext/couchbase/couchbase/operations/management/freeform.hxx +0 -55
  1995. data/ext/couchbase/couchbase/operations/management/group_drop.cxx +0 -51
  1996. data/ext/couchbase/couchbase/operations/management/group_drop.hxx +0 -49
  1997. data/ext/couchbase/couchbase/operations/management/group_get.cxx +0 -60
  1998. data/ext/couchbase/couchbase/operations/management/group_get.hxx +0 -50
  1999. data/ext/couchbase/couchbase/operations/management/group_get_all.cxx +0 -58
  2000. data/ext/couchbase/couchbase/operations/management/group_get_all.hxx +0 -49
  2001. data/ext/couchbase/couchbase/operations/management/group_upsert.cxx +0 -96
  2002. data/ext/couchbase/couchbase/operations/management/group_upsert.hxx +0 -51
  2003. data/ext/couchbase/couchbase/operations/management/query.hxx +0 -23
  2004. data/ext/couchbase/couchbase/operations/management/query_index_build_deferred.cxx +0 -88
  2005. data/ext/couchbase/couchbase/operations/management/query_index_build_deferred.hxx +0 -61
  2006. data/ext/couchbase/couchbase/operations/management/query_index_create.cxx +0 -149
  2007. data/ext/couchbase/couchbase/operations/management/query_index_create.hxx +0 -65
  2008. data/ext/couchbase/couchbase/operations/management/query_index_drop.cxx +0 -128
  2009. data/ext/couchbase/couchbase/operations/management/query_index_drop.hxx +0 -61
  2010. data/ext/couchbase/couchbase/operations/management/query_index_get_all.cxx +0 -126
  2011. data/ext/couchbase/couchbase/operations/management/query_index_get_all.hxx +0 -54
  2012. data/ext/couchbase/couchbase/operations/management/role_get_all.cxx +0 -58
  2013. data/ext/couchbase/couchbase/operations/management/role_get_all.hxx +0 -49
  2014. data/ext/couchbase/couchbase/operations/management/scope_create.cxx +0 -75
  2015. data/ext/couchbase/couchbase/operations/management/scope_create.hxx +0 -51
  2016. data/ext/couchbase/couchbase/operations/management/scope_drop.cxx +0 -70
  2017. data/ext/couchbase/couchbase/operations/management/scope_drop.hxx +0 -51
  2018. data/ext/couchbase/couchbase/operations/management/scope_get_all.cxx +0 -62
  2019. data/ext/couchbase/couchbase/operations/management/scope_get_all.hxx +0 -51
  2020. data/ext/couchbase/couchbase/operations/management/search.hxx +0 -30
  2021. data/ext/couchbase/couchbase/operations/management/search_get_stats.cxx +0 -41
  2022. data/ext/couchbase/couchbase/operations/management/search_get_stats.hxx +0 -48
  2023. data/ext/couchbase/couchbase/operations/management/search_index_analyze_document.cxx +0 -85
  2024. data/ext/couchbase/couchbase/operations/management/search_index_analyze_document.hxx +0 -54
  2025. data/ext/couchbase/couchbase/operations/management/search_index_control_ingest.cxx +0 -73
  2026. data/ext/couchbase/couchbase/operations/management/search_index_control_ingest.hxx +0 -52
  2027. data/ext/couchbase/couchbase/operations/management/search_index_control_plan_freeze.cxx +0 -73
  2028. data/ext/couchbase/couchbase/operations/management/search_index_control_plan_freeze.hxx +0 -57
  2029. data/ext/couchbase/couchbase/operations/management/search_index_control_query.cxx +0 -73
  2030. data/ext/couchbase/couchbase/operations/management/search_index_control_query.hxx +0 -52
  2031. data/ext/couchbase/couchbase/operations/management/search_index_drop.cxx +0 -72
  2032. data/ext/couchbase/couchbase/operations/management/search_index_drop.hxx +0 -51
  2033. data/ext/couchbase/couchbase/operations/management/search_index_get.cxx +0 -75
  2034. data/ext/couchbase/couchbase/operations/management/search_index_get.hxx +0 -54
  2035. data/ext/couchbase/couchbase/operations/management/search_index_get_all.cxx +0 -67
  2036. data/ext/couchbase/couchbase/operations/management/search_index_get_all.hxx +0 -51
  2037. data/ext/couchbase/couchbase/operations/management/search_index_get_documents_count.cxx +0 -79
  2038. data/ext/couchbase/couchbase/operations/management/search_index_get_documents_count.hxx +0 -53
  2039. data/ext/couchbase/couchbase/operations/management/search_index_get_stats.cxx +0 -71
  2040. data/ext/couchbase/couchbase/operations/management/search_index_get_stats.hxx +0 -52
  2041. data/ext/couchbase/couchbase/operations/management/search_index_upsert.cxx +0 -108
  2042. data/ext/couchbase/couchbase/operations/management/search_index_upsert.hxx +0 -52
  2043. data/ext/couchbase/couchbase/operations/management/user.hxx +0 -28
  2044. data/ext/couchbase/couchbase/operations/management/user_drop.cxx +0 -52
  2045. data/ext/couchbase/couchbase/operations/management/user_drop.hxx +0 -51
  2046. data/ext/couchbase/couchbase/operations/management/user_get.cxx +0 -61
  2047. data/ext/couchbase/couchbase/operations/management/user_get.hxx +0 -52
  2048. data/ext/couchbase/couchbase/operations/management/user_get_all.cxx +0 -59
  2049. data/ext/couchbase/couchbase/operations/management/user_get_all.hxx +0 -51
  2050. data/ext/couchbase/couchbase/operations/management/user_upsert.cxx +0 -101
  2051. data/ext/couchbase/couchbase/operations/management/user_upsert.hxx +0 -52
  2052. data/ext/couchbase/couchbase/operations/management/view.hxx +0 -23
  2053. data/ext/couchbase/couchbase/operations/management/view_index_drop.cxx +0 -46
  2054. data/ext/couchbase/couchbase/operations/management/view_index_drop.hxx +0 -52
  2055. data/ext/couchbase/couchbase/operations/management/view_index_get.cxx +0 -74
  2056. data/ext/couchbase/couchbase/operations/management/view_index_get.hxx +0 -53
  2057. data/ext/couchbase/couchbase/operations/management/view_index_get_all.cxx +0 -108
  2058. data/ext/couchbase/couchbase/operations/management/view_index_get_all.hxx +0 -52
  2059. data/ext/couchbase/couchbase/operations/management/view_index_upsert.cxx +0 -71
  2060. data/ext/couchbase/couchbase/operations/management/view_index_upsert.hxx +0 -51
  2061. data/ext/couchbase/couchbase/operations/mcbp_noop.cxx +0 -38
  2062. data/ext/couchbase/couchbase/operations/mcbp_noop.hxx +0 -49
  2063. data/ext/couchbase/couchbase/operations.hxx +0 -42
  2064. data/ext/couchbase/couchbase/origin.hxx +0 -185
  2065. data/ext/couchbase/couchbase/platform/CMakeLists.txt +0 -16
  2066. data/ext/couchbase/couchbase/platform/backtrace.c +0 -189
  2067. data/ext/couchbase/couchbase/platform/base64.cc +0 -234
  2068. data/ext/couchbase/couchbase/platform/base64.h +0 -44
  2069. data/ext/couchbase/couchbase/platform/dirutils.cc +0 -123
  2070. data/ext/couchbase/couchbase/platform/dirutils.h +0 -43
  2071. data/ext/couchbase/couchbase/platform/random.cc +0 -120
  2072. data/ext/couchbase/couchbase/platform/random.h +0 -39
  2073. data/ext/couchbase/couchbase/platform/string_hex.cc +0 -99
  2074. data/ext/couchbase/couchbase/platform/string_hex.h +0 -50
  2075. data/ext/couchbase/couchbase/platform/terminate_handler.cc +0 -125
  2076. data/ext/couchbase/couchbase/platform/terminate_handler.h +0 -36
  2077. data/ext/couchbase/couchbase/platform/uuid.cc +0 -98
  2078. data/ext/couchbase/couchbase/platform/uuid.h +0 -56
  2079. data/ext/couchbase/couchbase/protocol/CMakeLists.txt +0 -42
  2080. data/ext/couchbase/couchbase/protocol/client_opcode.hxx +0 -359
  2081. data/ext/couchbase/couchbase/protocol/client_opcode_fmt.hxx +0 -316
  2082. data/ext/couchbase/couchbase/protocol/client_request.cxx +0 -37
  2083. data/ext/couchbase/couchbase/protocol/client_request.hxx +0 -157
  2084. data/ext/couchbase/couchbase/protocol/client_response.cxx +0 -74
  2085. data/ext/couchbase/couchbase/protocol/client_response.hxx +0 -211
  2086. data/ext/couchbase/couchbase/protocol/cmd_append.cxx +0 -82
  2087. data/ext/couchbase/couchbase/protocol/cmd_append.hxx +0 -107
  2088. data/ext/couchbase/couchbase/protocol/cmd_cluster_map_change_notification.cxx +0 -51
  2089. data/ext/couchbase/couchbase/protocol/cmd_cluster_map_change_notification.hxx +0 -57
  2090. data/ext/couchbase/couchbase/protocol/cmd_decrement.cxx +0 -112
  2091. data/ext/couchbase/couchbase/protocol/cmd_decrement.hxx +0 -131
  2092. data/ext/couchbase/couchbase/protocol/cmd_exists.cxx +0 -92
  2093. data/ext/couchbase/couchbase/protocol/cmd_exists.hxx +0 -121
  2094. data/ext/couchbase/couchbase/protocol/cmd_get.cxx +0 -63
  2095. data/ext/couchbase/couchbase/protocol/cmd_get.hxx +0 -101
  2096. data/ext/couchbase/couchbase/protocol/cmd_get_and_lock.cxx +0 -68
  2097. data/ext/couchbase/couchbase/protocol/cmd_get_and_lock.hxx +0 -117
  2098. data/ext/couchbase/couchbase/protocol/cmd_get_and_touch.cxx +0 -70
  2099. data/ext/couchbase/couchbase/protocol/cmd_get_and_touch.hxx +0 -117
  2100. data/ext/couchbase/couchbase/protocol/cmd_get_cluster_config.cxx +0 -84
  2101. data/ext/couchbase/couchbase/protocol/cmd_get_cluster_config.hxx +0 -89
  2102. data/ext/couchbase/couchbase/protocol/cmd_get_collection_id.cxx +0 -50
  2103. data/ext/couchbase/couchbase/protocol/cmd_get_collection_id.hxx +0 -98
  2104. data/ext/couchbase/couchbase/protocol/cmd_get_collections_manifest.cxx +0 -44
  2105. data/ext/couchbase/couchbase/protocol/cmd_get_collections_manifest.hxx +0 -84
  2106. data/ext/couchbase/couchbase/protocol/cmd_get_error_map.cxx +0 -59
  2107. data/ext/couchbase/couchbase/protocol/cmd_get_error_map.hxx +0 -103
  2108. data/ext/couchbase/couchbase/protocol/cmd_get_meta.cxx +0 -74
  2109. data/ext/couchbase/couchbase/protocol/cmd_get_meta.hxx +0 -119
  2110. data/ext/couchbase/couchbase/protocol/cmd_hello.cxx +0 -66
  2111. data/ext/couchbase/couchbase/protocol/cmd_hello.hxx +0 -144
  2112. data/ext/couchbase/couchbase/protocol/cmd_increment.cxx +0 -117
  2113. data/ext/couchbase/couchbase/protocol/cmd_increment.hxx +0 -131
  2114. data/ext/couchbase/couchbase/protocol/cmd_info.hxx +0 -29
  2115. data/ext/couchbase/couchbase/protocol/cmd_insert.cxx +0 -92
  2116. data/ext/couchbase/couchbase/protocol/cmd_insert.hxx +0 -123
  2117. data/ext/couchbase/couchbase/protocol/cmd_lookup_in.cxx +0 -109
  2118. data/ext/couchbase/couchbase/protocol/cmd_lookup_in.hxx +0 -165
  2119. data/ext/couchbase/couchbase/protocol/cmd_mutate_in.cxx +0 -174
  2120. data/ext/couchbase/couchbase/protocol/cmd_mutate_in.hxx +0 -311
  2121. data/ext/couchbase/couchbase/protocol/cmd_noop.cxx +0 -36
  2122. data/ext/couchbase/couchbase/protocol/cmd_noop.hxx +0 -75
  2123. data/ext/couchbase/couchbase/protocol/cmd_prepend.cxx +0 -82
  2124. data/ext/couchbase/couchbase/protocol/cmd_prepend.hxx +0 -102
  2125. data/ext/couchbase/couchbase/protocol/cmd_remove.cxx +0 -83
  2126. data/ext/couchbase/couchbase/protocol/cmd_remove.hxx +0 -93
  2127. data/ext/couchbase/couchbase/protocol/cmd_replace.cxx +0 -105
  2128. data/ext/couchbase/couchbase/protocol/cmd_replace.hxx +0 -130
  2129. data/ext/couchbase/couchbase/protocol/cmd_sasl_auth.cxx +0 -40
  2130. data/ext/couchbase/couchbase/protocol/cmd_sasl_auth.hxx +0 -97
  2131. data/ext/couchbase/couchbase/protocol/cmd_sasl_list_mechs.cxx +0 -48
  2132. data/ext/couchbase/couchbase/protocol/cmd_sasl_list_mechs.hxx +0 -82
  2133. data/ext/couchbase/couchbase/protocol/cmd_sasl_step.cxx +0 -40
  2134. data/ext/couchbase/couchbase/protocol/cmd_sasl_step.hxx +0 -97
  2135. data/ext/couchbase/couchbase/protocol/cmd_select_bucket.cxx +0 -36
  2136. data/ext/couchbase/couchbase/protocol/cmd_select_bucket.hxx +0 -82
  2137. data/ext/couchbase/couchbase/protocol/cmd_touch.cxx +0 -57
  2138. data/ext/couchbase/couchbase/protocol/cmd_touch.hxx +0 -84
  2139. data/ext/couchbase/couchbase/protocol/cmd_unlock.cxx +0 -48
  2140. data/ext/couchbase/couchbase/protocol/cmd_unlock.hxx +0 -81
  2141. data/ext/couchbase/couchbase/protocol/cmd_upsert.cxx +0 -104
  2142. data/ext/couchbase/couchbase/protocol/cmd_upsert.hxx +0 -125
  2143. data/ext/couchbase/couchbase/protocol/datatype.hxx +0 -48
  2144. data/ext/couchbase/couchbase/protocol/durability_level.hxx +0 -59
  2145. data/ext/couchbase/couchbase/protocol/durability_level_fmt.hxx +0 -52
  2146. data/ext/couchbase/couchbase/protocol/enhanced_error_info.hxx +0 -28
  2147. data/ext/couchbase/couchbase/protocol/enhanced_error_info_fmt.hxx +0 -44
  2148. data/ext/couchbase/couchbase/protocol/frame_info_id.hxx +0 -142
  2149. data/ext/couchbase/couchbase/protocol/frame_info_id_fmt.hxx +0 -79
  2150. data/ext/couchbase/couchbase/protocol/hello_feature.hxx +0 -186
  2151. data/ext/couchbase/couchbase/protocol/hello_feature_fmt.hxx +0 -106
  2152. data/ext/couchbase/couchbase/protocol/magic.hxx +0 -53
  2153. data/ext/couchbase/couchbase/protocol/magic_fmt.hxx +0 -58
  2154. data/ext/couchbase/couchbase/protocol/server_opcode.hxx +0 -39
  2155. data/ext/couchbase/couchbase/protocol/server_opcode_fmt.hxx +0 -46
  2156. data/ext/couchbase/couchbase/protocol/server_request.hxx +0 -121
  2157. data/ext/couchbase/couchbase/protocol/status.cxx +0 -187
  2158. data/ext/couchbase/couchbase/protocol/status.hxx +0 -180
  2159. data/ext/couchbase/couchbase/protocol/status_fmt.hxx +0 -241
  2160. data/ext/couchbase/couchbase/query_profile_mode.hxx +0 -27
  2161. data/ext/couchbase/couchbase/sasl/CMakeLists.txt +0 -16
  2162. data/ext/couchbase/couchbase/sasl/client.cc +0 -50
  2163. data/ext/couchbase/couchbase/sasl/client.h +0 -128
  2164. data/ext/couchbase/couchbase/sasl/context.cc +0 -34
  2165. data/ext/couchbase/couchbase/sasl/context.h +0 -52
  2166. data/ext/couchbase/couchbase/sasl/error.h +0 -28
  2167. data/ext/couchbase/couchbase/sasl/error_fmt.h +0 -70
  2168. data/ext/couchbase/couchbase/sasl/mechanism.cc +0 -45
  2169. data/ext/couchbase/couchbase/sasl/mechanism.h +0 -52
  2170. data/ext/couchbase/couchbase/sasl/plain/plain.cc +0 -39
  2171. data/ext/couchbase/couchbase/sasl/plain/plain.h +0 -54
  2172. data/ext/couchbase/couchbase/sasl/scram-sha/scram-sha.cc +0 -372
  2173. data/ext/couchbase/couchbase/sasl/scram-sha/scram-sha.h +0 -184
  2174. data/ext/couchbase/couchbase/sasl/scram-sha/stringutils.cc +0 -82
  2175. data/ext/couchbase/couchbase/sasl/scram-sha/stringutils.h +0 -48
  2176. data/ext/couchbase/couchbase/search_highlight_style.hxx +0 -23
  2177. data/ext/couchbase/couchbase/search_scan_consistency.hxx +0 -23
  2178. data/ext/couchbase/couchbase/service_type.hxx +0 -31
  2179. data/ext/couchbase/couchbase/service_type_fmt.hxx +0 -61
  2180. data/ext/couchbase/couchbase/timeout_defaults.hxx +0 -42
  2181. data/ext/couchbase/couchbase/topology/CMakeLists.txt +0 -9
  2182. data/ext/couchbase/couchbase/topology/capabilities.hxx +0 -43
  2183. data/ext/couchbase/couchbase/topology/capabilities_fmt.hxx +0 -106
  2184. data/ext/couchbase/couchbase/topology/collections_manifest.hxx +0 -42
  2185. data/ext/couchbase/couchbase/topology/collections_manifest_fmt.hxx +0 -52
  2186. data/ext/couchbase/couchbase/topology/collections_manifest_json.hxx +0 -50
  2187. data/ext/couchbase/couchbase/topology/configuration.cxx +0 -223
  2188. data/ext/couchbase/couchbase/topology/configuration.hxx +0 -120
  2189. data/ext/couchbase/couchbase/topology/configuration_fmt.hxx +0 -166
  2190. data/ext/couchbase/couchbase/topology/configuration_json.hxx +0 -259
  2191. data/ext/couchbase/couchbase/topology/error_map.hxx +0 -149
  2192. data/ext/couchbase/couchbase/topology/error_map_fmt.hxx +0 -94
  2193. data/ext/couchbase/couchbase/topology/error_map_json.hxx +0 -88
  2194. data/ext/couchbase/couchbase/tracing/CMakeLists.txt +0 -9
  2195. data/ext/couchbase/couchbase/tracing/constants.hxx +0 -274
  2196. data/ext/couchbase/couchbase/tracing/noop_tracer.hxx +0 -55
  2197. data/ext/couchbase/couchbase/tracing/threshold_logging_options.hxx +0 -68
  2198. data/ext/couchbase/couchbase/tracing/threshold_logging_tracer.cxx +0 -422
  2199. data/ext/couchbase/couchbase/tracing/threshold_logging_tracer.hxx +0 -49
  2200. data/ext/couchbase/couchbase/utils/CMakeLists.txt +0 -17
  2201. data/ext/couchbase/couchbase/utils/byteswap.cxx +0 -45
  2202. data/ext/couchbase/couchbase/utils/byteswap.hxx +0 -49
  2203. data/ext/couchbase/couchbase/utils/connection_string.cxx +0 -420
  2204. data/ext/couchbase/couchbase/utils/connection_string.hxx +0 -76
  2205. data/ext/couchbase/couchbase/utils/crc32.hxx +0 -48
  2206. data/ext/couchbase/couchbase/utils/duration_parser.cxx +0 -193
  2207. data/ext/couchbase/couchbase/utils/duration_parser.hxx +0 -45
  2208. data/ext/couchbase/couchbase/utils/join_strings.hxx +0 -65
  2209. data/ext/couchbase/couchbase/utils/json.cxx +0 -71
  2210. data/ext/couchbase/couchbase/utils/json.hxx +0 -37
  2211. data/ext/couchbase/couchbase/utils/json_stream_control.hxx +0 -32
  2212. data/ext/couchbase/couchbase/utils/json_streaming_lexer.cxx +0 -394
  2213. data/ext/couchbase/couchbase/utils/json_streaming_lexer.hxx +0 -58
  2214. data/ext/couchbase/couchbase/utils/movable_function.hxx +0 -110
  2215. data/ext/couchbase/couchbase/utils/name_codec.hxx +0 -41
  2216. data/ext/couchbase/couchbase/utils/unsigned_leb128.hxx +0 -181
  2217. data/ext/couchbase/couchbase/utils/url_codec.cxx +0 -404
  2218. data/ext/couchbase/couchbase/utils/url_codec.hxx +0 -72
  2219. data/ext/couchbase/couchbase/view_scan_consistency.hxx +0 -27
  2220. data/ext/couchbase/couchbase/view_sort_order.hxx +0 -23
  2221. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/append.hpp +0 -217
  2222. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/as_tuple.hpp +0 -246
  2223. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/deferred.hpp +0 -104
  2224. data/ext/couchbase/third_party/asio/asio/include/asio/experimental/impl/prepend.hpp +0 -217
  2225. data/ext/couchbase/third_party/asio/asio/include/asio/impl/compose.hpp +0 -707
  2226. data/ext/couchbase/third_party/json/external/PEGTL/include/tao/pegtl/internal/dependent_true.hpp +0 -16
  2227. /data/ext/couchbase/{couchbase → core}/logger/custom_rotating_file_sink.hxx +0 -0
  2228. /data/ext/couchbase/{couchbase → core}/platform/backtrace.h +0 -0
@@ -0,0 +1,2413 @@
1
+ /*
2
+ * Copyright 2021-Present Couchbase, Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #include "attempt_context_impl.hxx"
18
+
19
+ #include "active_transaction_record.hxx"
20
+ #include "atr_ids.hxx"
21
+ #include "attempt_context_testing_hooks.hxx"
22
+ #include "durability_level.hxx"
23
+ #include "forward_compat.hxx"
24
+ #include "staged_mutation.hxx"
25
+
26
+ #include "attempt_state.hxx"
27
+ #include "internal/exceptions_internal.hxx"
28
+ #include "internal/logging.hxx"
29
+ #include "internal/utils.hxx"
30
+
31
+ namespace couchbase::core::transactions
32
+ {
33
+
34
+ // statement constants for queries
35
+ static const std::string BEGIN_WORK{ "BEGIN WORK" };
36
+ static const std::string COMMIT{ "COMMIT" };
37
+ static const std::string ROLLBACK{ "ROLLBACK" };
38
+ static const std::string KV_GET{ "EXECUTE __get" };
39
+ static const std::string KV_INSERT{ "EXECUTE __insert" };
40
+ static const std::string KV_REPLACE{ "EXECUTE __update" };
41
+ static const std::string KV_REMOVE{ "EXECUTE __delete" };
42
+ static const tao::json::value KV_TXDATA{ { "kv", true } };
43
+
44
+ // the config may have nullptr for attempt context hooks, so we use the noop here in that case
45
+ static auto noop_hooks = attempt_context_testing_hooks{};
46
+
47
+ std::shared_ptr<core::cluster>
48
+ attempt_context_impl::cluster_ref()
49
+ {
50
+ return overall_.cluster_ref();
51
+ }
52
+
53
+ attempt_context_impl::attempt_context_impl(transaction_context& transaction_ctx)
54
+ : overall_(transaction_ctx)
55
+ , staged_mutations_(std::make_unique<staged_mutation_queue>())
56
+ , hooks_(overall_.config().attempt_context_hooks ? *overall_.config().attempt_context_hooks : noop_hooks)
57
+ {
58
+ // put a new transaction_attempt in the context...
59
+ overall_.add_attempt();
60
+ CB_ATTEMPT_CTX_LOG_TRACE(this,
61
+ "added new attempt, state {}, expiration in {}ms",
62
+ attempt_state_name(state()),
63
+ std::chrono::duration_cast<std::chrono::milliseconds>(overall_.remaining()).count());
64
+ }
65
+
66
+ attempt_context_impl::~attempt_context_impl() = default;
67
+
68
+ template<typename Handler>
69
+ void
70
+ attempt_context_impl::check_and_handle_blocking_transactions(const transaction_get_result& doc, forward_compat_stage stage, Handler&& cb)
71
+ {
72
+ // The main reason to require doc to be fetched inside the transaction is we can detect this on the client side
73
+ if (doc.links().has_staged_write()) {
74
+ // Check not just writing the same doc twice in the same transaction
75
+ // NOTE: we check the transaction rather than attempt id. This is to handle [RETRY-ERR-AMBIG-REPLACE].
76
+ if (doc.links().staged_transaction_id().value() == transaction_id()) {
77
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "doc {} has been written by this transaction, ok to continue", doc.id());
78
+ return cb(std::nullopt);
79
+ }
80
+ if (doc.links().atr_id() && doc.links().atr_bucket_name() && doc.links().staged_attempt_id()) {
81
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "doc {} in another txn, checking atr...", doc.id());
82
+ auto err = forward_compat::check(stage, doc.links().forward_compat());
83
+ if (err) {
84
+ return cb(err);
85
+ }
86
+ exp_delay delay(std::chrono::milliseconds(50), std::chrono::milliseconds(500), std::chrono::seconds(1));
87
+ return check_atr_entry_for_blocking_document(doc, delay, std::move(cb));
88
+ }
89
+ CB_ATTEMPT_CTX_LOG_DEBUG(this,
90
+ "doc {} is in another transaction {}, but doesn't have enough info to check the atr. "
91
+ "probably a bug, proceeding to overwrite",
92
+ doc.id(),
93
+ *doc.links().staged_attempt_id());
94
+ }
95
+ return cb(std::nullopt);
96
+ }
97
+
98
+ transaction_get_result
99
+ attempt_context_impl::get(const core::document_id& id)
100
+ {
101
+ auto barrier = std::make_shared<std::promise<transaction_get_result>>();
102
+ auto f = barrier->get_future();
103
+ get(id, [barrier](std::exception_ptr err, std::optional<transaction_get_result> res) {
104
+ if (err) {
105
+ barrier->set_exception(err);
106
+ } else {
107
+ barrier->set_value(*res);
108
+ }
109
+ });
110
+ return f.get();
111
+ }
112
+ void
113
+ attempt_context_impl::get(const core::document_id& id, Callback&& cb)
114
+ {
115
+ if (op_list_.get_mode().is_query()) {
116
+ return get_with_query(id, false, std::move(cb));
117
+ }
118
+ cache_error_async(cb, [&]() mutable {
119
+ check_if_done(cb);
120
+ do_get(
121
+ id,
122
+ std::nullopt,
123
+ [this, id, cb = std::move(cb)](
124
+ std::optional<error_class> ec, std::optional<std::string> err_message, std::optional<transaction_get_result> res) mutable {
125
+ if (!ec) {
126
+ ec = hooks_.after_get_complete(this, id.key());
127
+ }
128
+ if (ec) {
129
+ switch (*ec) {
130
+ case FAIL_EXPIRY:
131
+ return op_completed_with_error(std::move(cb),
132
+ transaction_operation_failed(*ec, "transaction expired during get").expired());
133
+ case FAIL_DOC_NOT_FOUND:
134
+ return op_completed_with_error(
135
+ std::move(cb),
136
+ transaction_operation_failed(*ec, fmt::format("document not found {}", err_message.value_or("")))
137
+ .cause(external_exception::DOCUMENT_NOT_FOUND_EXCEPTION));
138
+ case FAIL_TRANSIENT:
139
+ return op_completed_with_error(
140
+ std::move(cb),
141
+ transaction_operation_failed(*ec, fmt::format("transient failure in get {}", err_message.value_or("")))
142
+ .retry());
143
+ case FAIL_HARD:
144
+ return op_completed_with_error(
145
+ std::move(cb),
146
+ transaction_operation_failed(*ec, fmt::format("fail hard in get {}", err_message.value_or(""))).no_rollback());
147
+ default: {
148
+ auto msg = fmt::format("got error \"{}\" while getting doc {}", err_message.value_or(""), id.key());
149
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, msg));
150
+ }
151
+ }
152
+ } else {
153
+ if (!res) {
154
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(*ec, "document not found"));
155
+ }
156
+ auto err = forward_compat::check(forward_compat_stage::GETS, res->links().forward_compat());
157
+ if (err) {
158
+ return op_completed_with_error(std::move(cb), *err);
159
+ }
160
+ return op_completed_with_callback(std::move(cb), res);
161
+ }
162
+ });
163
+ });
164
+ }
165
+
166
+ std::optional<transaction_get_result>
167
+ attempt_context_impl::get_optional(const core::document_id& id)
168
+ {
169
+ auto barrier = std::make_shared<std::promise<std::optional<transaction_get_result>>>();
170
+ auto f = barrier->get_future();
171
+ get_optional(id, [barrier](std::exception_ptr err, std::optional<transaction_get_result> res) {
172
+ if (err) {
173
+ return barrier->set_exception(err);
174
+ }
175
+ return barrier->set_value(res);
176
+ });
177
+ return f.get();
178
+ }
179
+
180
+ void
181
+ attempt_context_impl::get_optional(const core::document_id& id, Callback&& cb)
182
+ {
183
+
184
+ if (op_list_.get_mode().is_query()) {
185
+ return get_with_query(id, true, std::move(cb));
186
+ }
187
+ cache_error_async(cb, [&]() {
188
+ ensure_open_bucket(id.bucket(), [this, id, cb = std::move(cb)](std::error_code ec) mutable {
189
+ if (ec) {
190
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, ec.message()));
191
+ }
192
+ check_if_done(cb);
193
+ do_get(id,
194
+ std::nullopt,
195
+ [this, id, cb = std::move(cb)](std::optional<error_class> ec,
196
+ std::optional<std::string> err_message,
197
+ std::optional<transaction_get_result> res) mutable {
198
+ if (!ec) {
199
+ ec = hooks_.after_get_complete(this, id.key());
200
+ }
201
+ if (ec) {
202
+ switch (*ec) {
203
+ case FAIL_EXPIRY:
204
+ return op_completed_with_error(
205
+ std::move(cb),
206
+ transaction_operation_failed(
207
+ *ec, fmt::format("transaction expired during get {}", err_message.value_or("")))
208
+ .expired());
209
+ case FAIL_DOC_NOT_FOUND:
210
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>());
211
+ case FAIL_TRANSIENT:
212
+ return op_completed_with_error(
213
+ std::move(cb),
214
+ transaction_operation_failed(*ec, fmt::format("transient failure in get {}", err_message.value_or("")))
215
+ .retry());
216
+ case FAIL_HARD:
217
+ return op_completed_with_error(
218
+ std::move(cb),
219
+ transaction_operation_failed(*ec, fmt::format("fail hard in get {}", err_message.value_or("")))
220
+ .no_rollback());
221
+ default: {
222
+ return op_completed_with_error(
223
+ std::move(cb),
224
+ transaction_operation_failed(FAIL_OTHER,
225
+ fmt::format("error getting {} {}", id.key(), err_message.value_or(""))));
226
+ }
227
+ }
228
+ } else {
229
+ if (res) {
230
+ auto err = forward_compat::check(forward_compat_stage::GETS, res->links().forward_compat());
231
+ if (err) {
232
+ return op_completed_with_error(std::move(cb), *err);
233
+ }
234
+ }
235
+ return op_completed_with_callback(std::move(cb), res);
236
+ }
237
+ });
238
+ });
239
+ });
240
+ }
241
+
242
+ core::operations::mutate_in_request
243
+ attempt_context_impl::create_staging_request(const core::document_id& id,
244
+ const transaction_get_result* document,
245
+ const std::string type,
246
+ const std::string op_id,
247
+ std::optional<std::vector<std::byte>> content)
248
+ {
249
+ core::operations::mutate_in_request req{ id };
250
+ tao::json::value txn;
251
+ txn["id"] = tao::json::empty_object;
252
+ txn["id"]["txn"] = transaction_id();
253
+ txn["id"]["atmpt"] = this->id();
254
+ txn["id"]["op"] = op_id;
255
+ txn["atr"] = tao::json::empty_object;
256
+ txn["atr"]["id"] = atr_id();
257
+ txn["atr"]["bkt"] = atr_id_->bucket();
258
+ txn["atr"]["scp"] = atr_id_->scope();
259
+ txn["atr"]["coll"] = atr_id_->collection();
260
+ txn["op"] = tao::json::empty_object;
261
+ txn["op"]["type"] = type;
262
+
263
+ if (document != nullptr && document->metadata()) {
264
+ txn["restore"] = tao::json::empty_object;
265
+ if (document->metadata()->cas()) {
266
+ txn["restore"]["CAS"] = document->metadata()->cas().value();
267
+ }
268
+ if (document->metadata()->revid()) {
269
+ txn["restore"]["revid"] = document->metadata()->revid().value();
270
+ }
271
+ if (document->metadata()->exptime()) {
272
+ txn["restore"]["exptime"] = document->metadata()->exptime().value();
273
+ }
274
+ }
275
+
276
+ auto mut_specs =
277
+ couchbase::mutate_in_specs(couchbase::mutate_in_specs::upsert_raw("txn", core::utils::to_binary(jsonify(txn))).xattr().create_path());
278
+ if (type != "remove") {
279
+ mut_specs.push_back(couchbase::mutate_in_specs::upsert_raw("txn.op.stgd", content.value()).xattr());
280
+ }
281
+ mut_specs.push_back(
282
+ couchbase::mutate_in_specs::upsert("txn.op.crc32", couchbase::subdoc::mutate_in_macro::value_crc32c).xattr().create_path());
283
+ req.specs = mut_specs.specs();
284
+
285
+ return wrap_durable_request(req, overall_.config());
286
+ }
287
+
288
+ void
289
+ attempt_context_impl::replace_raw(const transaction_get_result& document, const std::vector<std::byte>& content, Callback&& cb)
290
+ {
291
+
292
+ if (op_list_.get_mode().is_query()) {
293
+ return replace_raw_with_query(document, content, std::move(cb));
294
+ }
295
+ return cache_error_async(cb, [&]() {
296
+ ensure_open_bucket(document.bucket(), [this, cb = std::move(cb), document, content](std::error_code ec) mutable {
297
+ if (ec) {
298
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, ec.message()));
299
+ }
300
+ try {
301
+ auto op_id = uid_generator::next();
302
+ // a get can return a 'empty' doc, so check for that and short-circuit the eventual error that will occur...
303
+ if (document.key().empty() || document.bucket().empty()) {
304
+ return op_completed_with_error(std::move(cb),
305
+ transaction_operation_failed(FAIL_DOC_NOT_FOUND, "can't replace empty doc")
306
+ .cause(external_exception::DOCUMENT_NOT_FOUND_EXCEPTION));
307
+ }
308
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "replacing {} with {}", document, to_string(content));
309
+ check_if_done(cb);
310
+ staged_mutation* existing_sm = staged_mutations_->find_any(document.id());
311
+ if (existing_sm != nullptr && existing_sm->type() == staged_mutation_type::REMOVE) {
312
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing REMOVE of {} while replacing", document);
313
+ return op_completed_with_error(
314
+ std::move(cb),
315
+ transaction_operation_failed(FAIL_DOC_NOT_FOUND,
316
+ "cannot replace a document that has been removed in the same transaction")
317
+ .cause(external_exception::DOCUMENT_NOT_FOUND_EXCEPTION));
318
+ }
319
+ if (check_expiry_pre_commit(STAGE_REPLACE, document.id().key())) {
320
+ return op_completed_with_error(std::move(cb),
321
+ transaction_operation_failed(FAIL_EXPIRY, "transaction expired").expired());
322
+ }
323
+
324
+ check_and_handle_blocking_transactions(
325
+ document,
326
+ forward_compat_stage::WWC_REPLACING,
327
+ [this, existing_sm = std::move(existing_sm), document = std::move(document), cb = std::move(cb), op_id, content](
328
+ std::optional<transaction_operation_failed> e1) mutable {
329
+ if (e1) {
330
+ return op_completed_with_error(std::move(cb), *e1);
331
+ }
332
+ auto tmp_doc =
333
+ document_id{ document.id().bucket(), document.id().scope(), document.id().collection(), document.id().key() };
334
+ select_atr_if_needed_unlocked(
335
+ tmp_doc,
336
+ [this, existing_sm = std::move(existing_sm), document = std::move(document), cb = std::move(cb), op_id, content](
337
+ std::optional<transaction_operation_failed> e2) mutable {
338
+ if (e2) {
339
+ return op_completed_with_error(std::move(cb), *e2);
340
+ }
341
+ if (existing_sm != nullptr && existing_sm->type() == staged_mutation_type::INSERT) {
342
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing INSERT of {} while replacing", document);
343
+ exp_delay delay(
344
+ std::chrono::milliseconds(5), std::chrono::milliseconds(300), overall_.config().expiration_time);
345
+ create_staged_insert(document.id(), content, existing_sm->doc().cas().value(), delay, op_id, std::move(cb));
346
+ return;
347
+ }
348
+ create_staged_replace(document, content, op_id, std::move(cb));
349
+ });
350
+ });
351
+ } catch (const client_error& e) {
352
+ error_class errc = e.ec();
353
+ switch (errc) {
354
+ case FAIL_EXPIRY:
355
+ expiry_overtime_mode_ = true;
356
+ throw transaction_operation_failed(errc, e.what()).expired();
357
+ default:
358
+ throw transaction_operation_failed(errc, e.what());
359
+ }
360
+ }
361
+ });
362
+ });
363
+ }
364
+
365
+ template<typename Handler>
366
+ void
367
+ attempt_context_impl::create_staged_replace(const transaction_get_result& document,
368
+ const std::vector<std::byte>& content,
369
+ const std::string& op_id,
370
+ Handler&& cb)
371
+ {
372
+ auto req = create_staging_request(document.id(), &document, "replace", op_id, content);
373
+ req.cas = document.cas();
374
+ req.access_deleted = true;
375
+ auto error_handler = [this](error_class ec, const std::string& msg, Handler&& cb) {
376
+ transaction_operation_failed err(ec, msg);
377
+ switch (ec) {
378
+ case FAIL_DOC_NOT_FOUND:
379
+ case FAIL_DOC_ALREADY_EXISTS:
380
+ case FAIL_CAS_MISMATCH:
381
+ case FAIL_TRANSIENT:
382
+ case FAIL_AMBIGUOUS:
383
+ return op_completed_with_error(std::move(cb), err.retry());
384
+ case FAIL_HARD:
385
+ return op_completed_with_error(std::move(cb), err.no_rollback());
386
+ default:
387
+ return op_completed_with_error(std::move(cb), err);
388
+ }
389
+ };
390
+ auto ec = hooks_.before_staged_replace(this, document.id().key());
391
+ if (ec) {
392
+ return error_handler(*ec, "before_staged_replace hook raised error", std::move(cb));
393
+ }
394
+ CB_ATTEMPT_CTX_LOG_TRACE(
395
+ this, "about to replace doc {} with cas {} in txn {}", document.id(), document.cas().value(), overall_.transaction_id());
396
+ overall_.cluster_ref()->execute(
397
+ req,
398
+ [this, document = std::move(document), content, cb = std::move(cb), error_handler = std::move(error_handler)](
399
+ core::operations::mutate_in_response resp) mutable {
400
+ if (auto ec2 = error_class_from_response(resp); ec2) {
401
+ return error_handler(*ec2, resp.ctx.ec().message(), std::move(cb));
402
+ }
403
+ auto err = hooks_.after_staged_replace_complete(this, document.id().key());
404
+ if (err) {
405
+ return error_handler(*err, "after_staged_replace_commit hook returned error", std::move(cb));
406
+ }
407
+ transaction_get_result out = document;
408
+ out.cas(resp.cas.value());
409
+ out.content(content);
410
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "replace staged content, result {}", out);
411
+ staged_mutations_->add(staged_mutation(out, content, staged_mutation_type::REPLACE));
412
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>(out));
413
+ });
414
+ }
415
+
416
+ transaction_get_result
417
+ attempt_context_impl::replace_raw(const transaction_get_result& document, const std::vector<std::byte>& content)
418
+ {
419
+ auto barrier = std::make_shared<std::promise<transaction_get_result>>();
420
+ auto f = barrier->get_future();
421
+ replace_raw(document, content, [barrier](std::exception_ptr err, std::optional<transaction_get_result> res) {
422
+ if (err) {
423
+ return barrier->set_exception(err);
424
+ }
425
+ barrier->set_value(*res);
426
+ });
427
+ return f.get();
428
+ }
429
+
430
+ transaction_get_result
431
+ attempt_context_impl::insert_raw(const core::document_id& id, const std::vector<std::byte>& content)
432
+ {
433
+ auto barrier = std::make_shared<std::promise<transaction_get_result>>();
434
+ auto f = barrier->get_future();
435
+ insert_raw(id, content, [barrier](std::exception_ptr err, std::optional<transaction_get_result> res) {
436
+ if (err) {
437
+ return barrier->set_exception(err);
438
+ }
439
+ barrier->set_value(*res);
440
+ });
441
+ return f.get();
442
+ }
443
+
444
+ void
445
+ attempt_context_impl::insert_raw(const core::document_id& id, const std::vector<std::byte>& content, Callback&& cb)
446
+ {
447
+
448
+ if (op_list_.get_mode().is_query()) {
449
+ return insert_raw_with_query(id, content, std::move(cb));
450
+ }
451
+ return cache_error_async(cb, [&]() mutable {
452
+ ensure_open_bucket(id.bucket(), [this, id, content, cb = std::move(cb)](std::error_code ec) mutable {
453
+ if (ec) {
454
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, ec.message()));
455
+ }
456
+ try {
457
+ check_if_done(cb);
458
+ auto op_id = uid_generator::next();
459
+ staged_mutation* existing_sm = staged_mutations_->find_any(id);
460
+ if ((existing_sm != nullptr) &&
461
+ (existing_sm->type() == staged_mutation_type::INSERT || existing_sm->type() == staged_mutation_type::REPLACE)) {
462
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing insert or replace of {} while inserting", id);
463
+ return op_completed_with_error(
464
+ std::move(cb),
465
+ transaction_operation_failed(FAIL_DOC_ALREADY_EXISTS, "found existing insert or replace of same document"));
466
+ }
467
+ if (check_expiry_pre_commit(STAGE_INSERT, id.key())) {
468
+ return op_completed_with_error(std::move(cb),
469
+ transaction_operation_failed(FAIL_EXPIRY, "transaction expired").expired());
470
+ }
471
+ select_atr_if_needed_unlocked(
472
+ id, [this, existing_sm, cb = std::move(cb), id, op_id, content](std::optional<transaction_operation_failed> err) mutable {
473
+ if (err) {
474
+ return op_completed_with_error(std::move(cb), *err);
475
+ }
476
+ if (existing_sm != nullptr && existing_sm->type() == staged_mutation_type::REMOVE) {
477
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing remove of {} while inserting", id);
478
+ return create_staged_replace(existing_sm->doc(), content, op_id, std::move(cb));
479
+ }
480
+ uint64_t cas = 0;
481
+ exp_delay delay(std::chrono::milliseconds(5), std::chrono::milliseconds(300), overall_.config().expiration_time);
482
+ create_staged_insert(id, content, cas, delay, op_id, std::move(cb));
483
+ });
484
+ } catch (const std::exception& e) {
485
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
486
+ }
487
+ });
488
+ });
489
+ }
490
+
491
+ void
492
+ attempt_context_impl::select_atr_if_needed_unlocked(const core::document_id id,
493
+ std::function<void(std::optional<transaction_operation_failed>)>&& cb)
494
+ {
495
+ try {
496
+ std::unique_lock<std::mutex> lock(mutex_);
497
+ if (atr_id_) {
498
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "atr exists, moving on");
499
+ return cb(std::nullopt);
500
+ }
501
+ std::size_t vbucket_id = 0;
502
+ std::optional<const std::string> hook_atr = hooks_.random_atr_id_for_vbucket(this);
503
+ if (hook_atr) {
504
+ atr_id_ = atr_id_from_bucket_and_key(overall_.config(), id.bucket(), hook_atr.value());
505
+ } else {
506
+ vbucket_id = atr_ids::vbucket_for_key(id.key());
507
+ atr_id_ = atr_id_from_bucket_and_key(overall_.config(), id.bucket(), atr_ids::atr_id_for_vbucket(vbucket_id));
508
+ }
509
+ // TODO: cleanup the transaction_context - this should be set (threadsafe) from the above calls
510
+ overall_.atr_collection(collection_spec_from_id(id));
511
+ overall_.atr_id(atr_id_->key());
512
+ state(attempt_state::NOT_STARTED);
513
+ CB_ATTEMPT_CTX_LOG_TRACE(
514
+ this, R"(first mutated doc in transaction is "{}" on vbucket {}, so using atr "{}")", id, vbucket_id, atr_id_.value());
515
+ overall_.cleanup().add_collection({ atr_id_->bucket(), atr_id_->scope(), atr_id_->collection() });
516
+ set_atr_pending_locked(id, std::move(lock), std::move(cb));
517
+ } catch (const std::exception& e) {
518
+ CB_ATTEMPT_CTX_LOG_ERROR(this, "unexpected error \"{}\" during select atr if needed", e.what());
519
+ }
520
+ }
521
+ template<typename Handler, typename Delay>
522
+ void
523
+ attempt_context_impl::check_atr_entry_for_blocking_document(const transaction_get_result& doc, Delay delay, Handler&& cb)
524
+ {
525
+ try {
526
+ delay();
527
+ if (auto ec = hooks_.before_check_atr_entry_for_blocking_doc(this, doc.id().key())) {
528
+ return cb(transaction_operation_failed(FAIL_WRITE_WRITE_CONFLICT, "document is in another transaction").retry());
529
+ }
530
+ core::document_id atr_id(doc.links().atr_bucket_name().value(),
531
+ doc.links().atr_scope_name().value(),
532
+ doc.links().atr_collection_name().value(),
533
+ doc.links().atr_id().value());
534
+ active_transaction_record::get_atr(
535
+ cluster_ref(),
536
+ atr_id,
537
+ [this, delay = std::move(delay), cb = std::move(cb), doc = std::move(doc)](std::error_code err,
538
+ std::optional<active_transaction_record> atr) mutable {
539
+ if (!err) {
540
+ if (atr) {
541
+ auto entries = atr->entries();
542
+ auto it = std::find_if(entries.begin(), entries.end(), [&doc](const atr_entry& e) {
543
+ return e.attempt_id() == doc.links().staged_attempt_id();
544
+ });
545
+ if (it != entries.end()) {
546
+ auto fwd_err = forward_compat::check(forward_compat_stage::WWC_READING_ATR, it->forward_compat());
547
+ if (fwd_err) {
548
+ return cb(fwd_err);
549
+ }
550
+ switch (it->state()) {
551
+ case attempt_state::COMPLETED:
552
+ case attempt_state::ROLLED_BACK:
553
+ CB_ATTEMPT_CTX_LOG_DEBUG(
554
+ this, "existing atr entry can be ignored due to state {}", attempt_state_name(it->state()));
555
+ return cb(std::nullopt);
556
+ default:
557
+ CB_ATTEMPT_CTX_LOG_DEBUG(
558
+ this, "existing atr entry found in state {}, retrying", attempt_state_name(it->state()));
559
+ }
560
+ return check_atr_entry_for_blocking_document(doc, delay, std::move(cb));
561
+ }
562
+ }
563
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "no blocking atr entry");
564
+ return cb(std::nullopt);
565
+ }
566
+ // if we are here, there is still a write-write conflict
567
+ return cb(transaction_operation_failed(FAIL_WRITE_WRITE_CONFLICT, "document is in another transaction").retry());
568
+ });
569
+ } catch (const retry_operation_timeout&) {
570
+ return cb(transaction_operation_failed(FAIL_WRITE_WRITE_CONFLICT, "document is in another transaction").retry());
571
+ }
572
+ }
573
+ void
574
+ attempt_context_impl::remove(const transaction_get_result& document, VoidCallback&& cb)
575
+ {
576
+
577
+ if (op_list_.get_mode().is_query()) {
578
+ return remove_with_query(document, std::move(cb));
579
+ }
580
+ return cache_error_async(cb, [&]() mutable {
581
+ check_if_done(cb);
582
+ ensure_open_bucket(document.bucket(), [this, document, cb = std::move(cb)](std::error_code ec) mutable {
583
+ if (ec) {
584
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, ec.message()));
585
+ }
586
+ staged_mutation* existing_sm = staged_mutations_->find_any(document.id());
587
+ auto error_handler = [this](error_class ec, const std::string msg, VoidCallback&& cb) mutable {
588
+ transaction_operation_failed err(ec, msg);
589
+ switch (ec) {
590
+ case FAIL_EXPIRY:
591
+ expiry_overtime_mode_ = true;
592
+ return op_completed_with_error(std::move(cb), err.expired());
593
+ case FAIL_DOC_NOT_FOUND:
594
+ case FAIL_DOC_ALREADY_EXISTS:
595
+ case FAIL_CAS_MISMATCH:
596
+ case FAIL_TRANSIENT:
597
+ case FAIL_AMBIGUOUS:
598
+ return op_completed_with_error(std::move(cb), err.retry());
599
+ case FAIL_HARD:
600
+ return op_completed_with_error(std::move(cb), err.no_rollback());
601
+ default:
602
+ return op_completed_with_error(std::move(cb), err);
603
+ }
604
+ };
605
+ if (check_expiry_pre_commit(STAGE_REMOVE, document.id().key())) {
606
+ return error_handler(FAIL_EXPIRY, "transaction expired", std::move(cb));
607
+ }
608
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "removing {}", document);
609
+ auto op_id = uid_generator::next();
610
+ if (existing_sm != nullptr) {
611
+ if (existing_sm->type() == staged_mutation_type::REMOVE) {
612
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing REMOVE of {} while removing", document);
613
+ return op_completed_with_error(
614
+ std::move(cb),
615
+ transaction_operation_failed(FAIL_DOC_NOT_FOUND,
616
+ "cannot remove a document that has been removed in the same transaction")
617
+ .cause(external_exception::DOCUMENT_NOT_FOUND_EXCEPTION));
618
+ }
619
+ if (existing_sm->type() == staged_mutation_type::INSERT) {
620
+ remove_staged_insert(document.id(), std::move(cb));
621
+ return;
622
+ }
623
+ }
624
+ check_and_handle_blocking_transactions(
625
+ document,
626
+ forward_compat_stage::WWC_REMOVING,
627
+ [this, document = std::move(document), cb = std::move(cb), op_id, error_handler = std::move(error_handler)](
628
+ std::optional<transaction_operation_failed> err1) mutable {
629
+ if (err1) {
630
+ return op_completed_with_error(std::move(cb), *err1);
631
+ }
632
+ auto tmp_doc =
633
+ document_id{ document.id().bucket(), document.id().scope(), document.id().collection(), document.id().key() };
634
+ select_atr_if_needed_unlocked(
635
+ tmp_doc,
636
+ [document = std::move(document), cb = std::move(cb), this, op_id, error_handler = std::move(error_handler)](
637
+ std::optional<transaction_operation_failed> err2) mutable {
638
+ if (err2) {
639
+ return op_completed_with_error(std::move(cb), *err2);
640
+ }
641
+ if (auto ec = hooks_.before_staged_remove(this, document.id().key())) {
642
+ return error_handler(*ec, "before_staged_remove hook raised error", std::move(cb));
643
+ }
644
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "about to remove doc {} with cas {}", document.id(), document.cas().value());
645
+ auto req = create_staging_request(document.id(), &document, "remove", op_id);
646
+ req.cas = document.cas();
647
+ req.access_deleted = document.links().is_deleted();
648
+ overall_.cluster_ref()->execute(
649
+ req,
650
+ [this, document = std::move(document), cb = std::move(cb), error_handler = std::move(error_handler)](
651
+ core::operations::mutate_in_response resp) mutable {
652
+ auto ec = error_class_from_response(resp);
653
+ if (!ec) {
654
+ ec = hooks_.after_staged_remove_complete(this, document.id().key());
655
+ }
656
+ if (!ec) {
657
+ CB_ATTEMPT_CTX_LOG_TRACE(
658
+ this, "removed doc {} CAS={}, rc={}", document.id(), resp.cas.value(), resp.ctx.ec().message());
659
+ // TODO: this copy... can we do better?
660
+ transaction_get_result new_res = document;
661
+ new_res.cas(resp.cas.value());
662
+ staged_mutations_->add(staged_mutation(new_res, std::vector<std::byte>{}, staged_mutation_type::REMOVE));
663
+ return op_completed_with_callback(cb);
664
+ }
665
+ return error_handler(*ec, resp.ctx.ec().message(), std::move(cb));
666
+ });
667
+ });
668
+ });
669
+ });
670
+ });
671
+ }
672
+
673
+ void
674
+ attempt_context_impl::remove_staged_insert(const core::document_id& id, VoidCallback&& cb)
675
+ {
676
+ if (auto ec = error_if_expired_and_not_in_overtime(STAGE_REMOVE_STAGED_INSERT, id.key()); ec) {
677
+ return op_completed_with_error(
678
+ std::move(cb), transaction_operation_failed(FAIL_EXPIRY, std::string("expired in remove_staged_insert")).no_rollback().expired());
679
+ }
680
+
681
+ auto error_handler = [this](error_class ec, const std::string& msg, VoidCallback&& cb) mutable {
682
+ transaction_operation_failed err(ec, msg);
683
+ switch (ec) {
684
+ case FAIL_HARD:
685
+ return op_completed_with_error(std::move(cb), err.no_rollback());
686
+ default:
687
+ return op_completed_with_error(std::move(cb), err.retry());
688
+ }
689
+ };
690
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "removing staged insert {}", id);
691
+
692
+ if (auto err = hooks_.before_remove_staged_insert(this, id.key()); err) {
693
+ return error_handler(*err, "before_remove_staged_insert hook returned error", std::move(cb));
694
+ }
695
+
696
+ core::operations::mutate_in_request req{ id };
697
+ req.specs =
698
+ couchbase::mutate_in_specs{
699
+ couchbase::mutate_in_specs::remove("txn").xattr(),
700
+ }
701
+ .specs();
702
+ wrap_durable_request(req, overall_.config());
703
+ req.access_deleted = true;
704
+
705
+ overall_.cluster_ref()->execute(req,
706
+ [this, id = std::move(id), cb = std::move(cb), error_handler = std::move(error_handler)](
707
+ core::operations::mutate_in_response resp) mutable {
708
+ auto ec = error_class_from_response(resp);
709
+ if (!ec) {
710
+
711
+ if (auto err = hooks_.after_remove_staged_insert(this, id.key()); err) {
712
+ error_handler(*err, "after_remove_staged_insert hook returned error", std::move(cb));
713
+ return;
714
+ }
715
+ staged_mutations_->remove_any(id);
716
+ op_completed_with_callback(std::move(cb));
717
+ return;
718
+ }
719
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "remove_staged_insert got error {}", *ec);
720
+ return error_handler(*ec, resp.ctx.ec().message(), std::move(cb));
721
+ });
722
+ }
723
+
724
+ void
725
+ attempt_context_impl::remove(const transaction_get_result& document)
726
+ {
727
+ auto barrier = std::make_shared<std::promise<void>>();
728
+ auto f = barrier->get_future();
729
+ remove(document, [barrier](std::exception_ptr err) {
730
+ if (err) {
731
+ return barrier->set_exception(err);
732
+ }
733
+ barrier->set_value();
734
+ });
735
+ f.get();
736
+ }
737
+
738
+ static core::operations::query_request
739
+ wrap_query_request(const couchbase::transactions::transaction_query_options& opts, const transaction_context& txn_context)
740
+ {
741
+ // build what we can directly from the options:
742
+ auto req = core::impl::build_transaction_query_request(opts.get_query_options().build());
743
+ // set timeout to remaining time plus some extra time, so we don't time out right at expiry.
744
+ auto extra = core::timeout_defaults::key_value_durable_timeout;
745
+ if (!req.scan_consistency) {
746
+ req.scan_consistency = txn_context.config().query_config.scan_consistency;
747
+ }
748
+ auto remaining = std::chrono::duration_cast<std::chrono::milliseconds>(txn_context.remaining());
749
+ req.timeout = remaining + extra + std::chrono::milliseconds(1000); // match java with 1 second over the kv durable timeout.
750
+ req.raw["txtimeout"] = fmt::format("\"{}ms\"", remaining.count());
751
+ req.timeout = std::chrono::duration_cast<std::chrono::milliseconds>(txn_context.remaining()) + extra;
752
+ return req;
753
+ }
754
+
755
+ void
756
+ attempt_context_impl::query_begin_work(std::optional<std::string> query_context, std::function<void(std::exception_ptr)>&& cb)
757
+ {
758
+ // construct the txn_data and query options for the existing transaction
759
+ couchbase::transactions::transaction_query_options opts;
760
+ tao::json::value txdata;
761
+ txdata["id"] = tao::json::empty_object;
762
+ txdata["id"]["atmpt"] = id();
763
+ txdata["id"]["txn"] = transaction_id();
764
+ txdata["state"] = tao::json::empty_object;
765
+ txdata["state"]["timeLeftMs"] = overall_.remaining().count() / 1000000;
766
+ txdata["config"] = tao::json::empty_object;
767
+ txdata["config"]["kvTimeoutMs"] =
768
+ overall_.config().kv_timeout ? overall_.config().kv_timeout->count() : core::timeout_defaults::key_value_timeout.count();
769
+ txdata["config"]["numAtrs"] = 1024;
770
+ opts.raw("numatrs", jsonify(1024));
771
+ txdata["config"]["durabilityLevel"] = durability_level_to_string(overall_.config().level);
772
+ opts.raw("durability_level", durability_level_to_string_for_query(overall_.config().level));
773
+ if (atr_id_) {
774
+ txdata["atr"] = tao::json::empty_object;
775
+ txdata["atr"]["scp"] = atr_id_->scope();
776
+ txdata["atr"]["coll"] = atr_id_->collection();
777
+ txdata["atr"]["bkt"] = atr_id_->bucket();
778
+ txdata["atr"]["id"] = atr_id_->key();
779
+ } else if (overall_.config().metadata_collection) {
780
+ auto id = atr_id_from_bucket_and_key(overall_.config(), "", "");
781
+ txdata["atr"] = tao::json::empty_object;
782
+ txdata["atr"]["scp"] = id.scope();
783
+ txdata["atr"]["coll"] = id.collection();
784
+ txdata["atr"]["bkt"] = id.bucket();
785
+ opts.raw("atrcollection", fmt::format("\"`{}`.`{}`.`{}`\"", id.bucket(), id.scope(), id.collection()));
786
+ }
787
+ tao::json::value mutations = tao::json::empty_array;
788
+ if (!staged_mutations_->empty()) {
789
+ staged_mutations_->iterate([&mutations](staged_mutation& mut) {
790
+ mutations.push_back(tao::json::value{
791
+ { "scp", mut.doc().id().scope() },
792
+ { "coll", mut.doc().id().collection() },
793
+ { "bkt", mut.doc().id().bucket() },
794
+ { "id", mut.doc().id().key() },
795
+ { "cas", std::to_string(mut.doc().cas().value()) },
796
+ { "type", mut.type_as_string() },
797
+ });
798
+ });
799
+ }
800
+ txdata["mutations"] = mutations;
801
+ std::vector<core::json_string> params;
802
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "begin_work using txdata: {}", core::utils::json::generate(txdata));
803
+ wrap_query(BEGIN_WORK,
804
+ opts,
805
+ params,
806
+ txdata,
807
+ STAGE_QUERY_BEGIN_WORK,
808
+ false,
809
+ query_context,
810
+ [this, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response resp) mutable {
811
+ if (resp.served_by_node.empty()) {
812
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "begin_work didn't reach a query node, resetting mode to kv");
813
+ op_list_.reset_query_mode();
814
+ } else {
815
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "begin_work setting query node to {}", resp.served_by_node);
816
+ op_list_.set_query_node(resp.served_by_node);
817
+ }
818
+ // we check for expiry _after_ this call, so we always set the query node if we can.
819
+ if (has_expired_client_side(STAGE_QUERY_BEGIN_WORK, {})) {
820
+ return cb(std::make_exception_ptr(
821
+ transaction_operation_failed(FAIL_EXPIRY, "expired in BEGIN WORK").no_rollback().expired()));
822
+ }
823
+ return cb(err);
824
+ });
825
+ }
826
+
827
+ tao::json::value
828
+ choose_error(std::vector<tao::json::value>& errors)
829
+ {
830
+ auto chosen_error = errors.front();
831
+ if (errors.size() > 1) {
832
+ // if there's one with a "reason":{"cause", ...} field, choose it
833
+ for (const auto& e : errors) {
834
+ auto reason = e.find("reason");
835
+ auto cause = e.find("cause");
836
+ if (reason && !reason->is_null() && cause && !cause->is_null()) {
837
+ return e;
838
+ }
839
+ }
840
+ // ok, so now lets see if we have one with code in the range 17000-18000 and return that.
841
+ for (const auto& e : errors) {
842
+ auto code = e.at("code").as<uint64_t>();
843
+ if (code >= 17000 && code <= 18000) {
844
+ return e;
845
+ }
846
+ }
847
+ }
848
+ // then, just the first one.
849
+ return chosen_error;
850
+ }
851
+
852
+ std::exception_ptr
853
+ attempt_context_impl::handle_query_error(const core::operations::query_response& resp)
854
+ {
855
+ if (!resp.ctx.ec && !resp.meta.errors) {
856
+ return {};
857
+ }
858
+ auto [tx_err, query_result] = couchbase::core::impl::build_transaction_query_result(resp);
859
+ // TODO: look at ambiguous and unambiguous timeout errors vs the codes, etc...
860
+ CB_ATTEMPT_CTX_LOG_TRACE(
861
+ this, "handling query error {}, {} errors in meta_data", resp.ctx.ec.message(), resp.meta.errors ? "has" : "no");
862
+ if (resp.ctx.ec == couchbase::errc::common::ambiguous_timeout || resp.ctx.ec == couchbase::errc::common::unambiguous_timeout) {
863
+ return std::make_exception_ptr(query_attempt_expired(tx_err));
864
+ }
865
+ if (resp.ctx.ec == couchbase::errc::common::parsing_failure) {
866
+ return std::make_exception_ptr(query_parsing_failure(tx_err));
867
+ }
868
+ if (!resp.meta.errors) {
869
+ // can't choose an error, map using the ec...
870
+ external_exception cause =
871
+ (resp.ctx.ec == couchbase::errc::common::service_not_available ? SERVICE_NOT_AVAILABLE_EXCEPTION : COUCHBASE_EXCEPTION);
872
+ return std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, resp.ctx.ec.message()).cause(cause));
873
+ }
874
+ // TODO: we should have all the fields in these transactional query errors in the errors object. For now, lets
875
+ // parse the body, get the serialized info to decide which error to choose.
876
+ auto errors = core::utils::json::parse(resp.ctx.http_body)["errors"].get_array();
877
+
878
+ // just chose first one, to start with...
879
+ auto chosen_error = choose_error(errors);
880
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "chosen query error: {}", jsonify(chosen_error));
881
+ auto code = chosen_error.at("code").as<uint64_t>();
882
+
883
+ // we have a fixed strategy for these errors...
884
+ switch (code) {
885
+ case 1065:
886
+ return std::make_exception_ptr(
887
+ transaction_operation_failed(FAIL_OTHER, "N1QL Queries in transactions are supported in couchbase server 7.0 and later")
888
+ .cause(FEATURE_NOT_AVAILABLE_EXCEPTION));
889
+ case 1197:
890
+ return std::make_exception_ptr(
891
+ transaction_operation_failed(FAIL_OTHER, "This couchbase server requires all queries use a scope.")
892
+ .cause(FEATURE_NOT_AVAILABLE_EXCEPTION));
893
+ case 17004:
894
+ return std::make_exception_ptr(query_attempt_not_found(tx_err));
895
+ case 1080:
896
+ case 17010:
897
+ return std::make_exception_ptr(transaction_operation_failed(FAIL_EXPIRY, "transaction expired").expired());
898
+ case 17012:
899
+ return std::make_exception_ptr(document_exists(tx_err));
900
+ case 17014:
901
+ return std::make_exception_ptr(document_not_found(tx_err));
902
+ case 17015:
903
+ return std::make_exception_ptr(query_cas_mismatch(tx_err));
904
+ }
905
+
906
+ // For these errors, we will create a transaction_operation_failed from the info in it.
907
+ if (code >= 17000 && code <= 18000) {
908
+ // the assumption below is there's always a top-level msg.
909
+ // TODO: when we parse the errors more thoroughly in the client, we should be able to add a lot of info on the underlying
910
+ // cause of the error here (in addition to perhaps a more granular message).
911
+ transaction_operation_failed err(FAIL_OTHER, chosen_error.at("msg").as<std::string>());
912
+ // parse the body for now, get the serialized info to create a transaction_operation_failed:
913
+ if (const auto* cause = chosen_error.find("cause"); cause != nullptr) {
914
+ if (cause->find("retry")->get_boolean()) {
915
+ err.retry();
916
+ }
917
+ if (!cause->find("rollback")->get_boolean()) {
918
+ err.no_rollback();
919
+ }
920
+ if (auto raise = cause->find("raise")->get_string(); raise == std::string("expired")) {
921
+ err.expired();
922
+ } else if (raise == std::string("commit_ambiguous")) {
923
+ err.ambiguous();
924
+ } else if (raise == std::string("failed_post_commit")) {
925
+ err.failed_post_commit();
926
+ } else if (raise != std::string("failed")) {
927
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "unknown value in raise field: {}, raising failed", raise);
928
+ }
929
+ return std::make_exception_ptr(err);
930
+ }
931
+ }
932
+
933
+ return { std::make_exception_ptr(op_exception(tx_err)) };
934
+ }
935
+
936
+ void
937
+ attempt_context_impl::do_query(const std::string& statement,
938
+ const couchbase::transactions::transaction_query_options& opts,
939
+ std::optional<std::string> query_context,
940
+ QueryCallback&& cb)
941
+ {
942
+ std::vector<core::json_string> params;
943
+ tao::json::value txdata;
944
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "do_query called with statement {}", statement);
945
+ wrap_query(statement,
946
+ opts,
947
+ params,
948
+ txdata,
949
+ STAGE_QUERY,
950
+ true,
951
+ query_context,
952
+ [this, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response resp) mutable {
953
+ if (err) {
954
+ return op_completed_with_error(std::move(cb), err);
955
+ }
956
+ op_completed_with_callback(std::move(cb), std::optional<core::operations::query_response>(resp));
957
+ });
958
+ }
959
+ std::string
960
+ dump_request(const core::operations::query_request& req)
961
+ {
962
+ std::string raw = "{";
963
+ for (const auto& x : req.raw) {
964
+ raw += x.first;
965
+ raw += ":";
966
+ raw += x.second.str();
967
+ raw += ",";
968
+ }
969
+ raw += "}";
970
+ std::string params;
971
+ for (const auto& x : req.positional_parameters) {
972
+ params.append(x.str());
973
+ }
974
+ return fmt::format("request: {}, {}, {}", req.statement, params, raw);
975
+ }
976
+ void
977
+ attempt_context_impl::wrap_query(const std::string& statement,
978
+ const couchbase::transactions::transaction_query_options& opts,
979
+ const std::vector<core::json_string>& params,
980
+ const tao::json::value& txdata,
981
+ const std::string& hook_point,
982
+ bool check_expiry,
983
+ std::optional<std::string> query_context,
984
+ std::function<void(std::exception_ptr, core::operations::query_response)>&& cb)
985
+ {
986
+ auto req = wrap_query_request(opts, overall_);
987
+ if (statement != BEGIN_WORK) {
988
+ auto mode = op_list_.get_mode();
989
+ assert(mode.is_query());
990
+ if (!op_list_.get_mode().query_node.empty()) {
991
+ req.send_to_node = op_list_.get_mode().query_node;
992
+ }
993
+ }
994
+ // set the query_context, if one has been set, unless this query already has one
995
+ if (!query_context && !query_context_.empty()) {
996
+ req.query_context = query_context_;
997
+ } else if (query_context) {
998
+ req.query_context = query_context;
999
+ }
1000
+
1001
+ if (check_expiry) {
1002
+ if (has_expired_client_side(hook_point, std::nullopt)) {
1003
+ auto err = std::make_exception_ptr(
1004
+ transaction_operation_failed(FAIL_EXPIRY, fmt::format("{} expired in stage {}", statement, hook_point))
1005
+ .no_rollback()
1006
+ .expired());
1007
+ return cb(err, {});
1008
+ }
1009
+ }
1010
+
1011
+ if (!params.empty()) {
1012
+ req.positional_parameters = params;
1013
+ }
1014
+ if (statement != BEGIN_WORK) {
1015
+ req.raw["txid"] = jsonify(id());
1016
+ }
1017
+ if (txdata.is_object() && !txdata.get_object().empty()) {
1018
+ req.raw["txdata"] = core::utils::json::generate(txdata);
1019
+ }
1020
+ req.statement = statement;
1021
+ if (auto ec = hooks_.before_query(this, statement)) {
1022
+ auto err = std::make_exception_ptr(transaction_operation_failed(*ec, "before_query hook raised error"));
1023
+ if (statement == BEGIN_WORK) {
1024
+ return cb(std::make_exception_ptr(transaction_operation_failed(*ec, "before_query hook raised error").no_rollback()), {});
1025
+ }
1026
+ return cb(std::make_exception_ptr(transaction_operation_failed(*ec, "before_query hook raised error")), {});
1027
+ }
1028
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "http request: {}", dump_request(req));
1029
+ overall_.cluster_ref()->execute(req, [this, cb = std::move(cb)](core::operations::query_response resp) mutable {
1030
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "response: {} status: {}", resp.ctx.http_body, resp.meta.status);
1031
+ if (auto ec = hooks_.after_query(this, resp.ctx.statement)) {
1032
+ auto err = std::make_exception_ptr(transaction_operation_failed(*ec, "after_query hook raised error"));
1033
+ return cb(err, {});
1034
+ }
1035
+ cb(handle_query_error(resp), resp);
1036
+ });
1037
+ }
1038
+
1039
+ void
1040
+ attempt_context_impl::query(const std::string& statement,
1041
+ const couchbase::transactions::transaction_query_options& options,
1042
+ std::optional<std::string> query_context,
1043
+ QueryCallback&& cb)
1044
+ {
1045
+ return cache_error_async(cb, [&]() {
1046
+ check_if_done(cb);
1047
+ // decrement in_flight, as we just incremented it in cache_error_async.
1048
+ op_list_.set_query_mode(
1049
+ [this, statement, options, query_context, cb]() mutable {
1050
+ // set query context if set
1051
+ if (query_context) {
1052
+ query_context_ = query_context.value();
1053
+ }
1054
+ query_begin_work(query_context,
1055
+ [this, statement, query_context, options, cb = std::move(cb)](std::exception_ptr err) mutable {
1056
+ if (err) {
1057
+ return op_completed_with_error(std::move(cb), err);
1058
+ }
1059
+ return do_query(statement, options, query_context, std::move(cb));
1060
+ });
1061
+ },
1062
+ [this, statement, options, query_context, cb]() mutable { return do_query(statement, options, query_context, std::move(cb)); });
1063
+ });
1064
+ }
1065
+
1066
+ core::operations::query_response
1067
+ attempt_context_impl::do_core_query(const std::string& statement,
1068
+ const couchbase::transactions::transaction_query_options& options,
1069
+ std::optional<std::string> query_context)
1070
+ {
1071
+ auto barrier = std::make_shared<std::promise<core::operations::query_response>>();
1072
+ auto f = barrier->get_future();
1073
+ query(statement, options, query_context, [barrier](std::exception_ptr err, std::optional<core::operations::query_response> resp) {
1074
+ if (err) {
1075
+ return barrier->set_exception(err);
1076
+ }
1077
+ barrier->set_value(*resp);
1078
+ });
1079
+ return f.get();
1080
+ }
1081
+
1082
+ std::pair<couchbase::transaction_op_error_context, couchbase::transactions::transaction_query_result>
1083
+ attempt_context_impl::do_public_query(const std::string& statement,
1084
+ const couchbase::transactions::transaction_query_options& opts,
1085
+ std::optional<std::string> query_context)
1086
+ {
1087
+ try {
1088
+ auto result = do_core_query(statement, opts, query_context);
1089
+ return core::impl::build_transaction_query_result(result);
1090
+ } catch (const transaction_operation_failed& e) {
1091
+ return { e.get_error_ctx(), {} };
1092
+ } catch (const op_exception& qe) {
1093
+ return { qe.ctx(), {} };
1094
+ } catch (...) {
1095
+ // should not be necessary, but just in case...
1096
+ transaction_op_error_context ctx(couchbase::errc::transaction_op::unknown);
1097
+ return { ctx, {} };
1098
+ }
1099
+ }
1100
+
1101
+ std::vector<core::json_string>
1102
+ make_params(const core::document_id& id, std::optional<std::vector<std::byte>> content)
1103
+ {
1104
+ std::vector<core::json_string> retval;
1105
+ auto keyspace = fmt::format("default:`{}`.`{}`.`{}`", id.bucket(), id.scope(), id.collection());
1106
+ retval.push_back(jsonify(keyspace));
1107
+ if (!id.key().empty()) {
1108
+ retval.push_back(jsonify(id.key()));
1109
+ }
1110
+ if (content) {
1111
+ retval.push_back(std::string(reinterpret_cast<const char*>(content->data()), content->size()));
1112
+ retval.push_back(core::utils::json::generate(tao::json::empty_object));
1113
+ }
1114
+ return retval;
1115
+ }
1116
+
1117
+ tao::json::value
1118
+ make_kv_txdata(std::optional<transaction_get_result> doc = std::nullopt)
1119
+ {
1120
+ tao::json::value retval{ { "kv", true } };
1121
+ if (doc) {
1122
+ retval["scas"] = fmt::format("{}", doc->cas().value());
1123
+ doc->links().append_to_json(retval);
1124
+ }
1125
+ return retval;
1126
+ }
1127
+
1128
+ void
1129
+ attempt_context_impl::get_with_query(const core::document_id& id, bool optional, Callback&& cb)
1130
+ {
1131
+ cache_error_async(cb, [&]() {
1132
+ auto params = make_params(id, {});
1133
+ couchbase::transactions::transaction_query_options opts;
1134
+ opts.readonly(true);
1135
+ return wrap_query(KV_GET,
1136
+ opts,
1137
+ params,
1138
+ make_kv_txdata(),
1139
+ STAGE_QUERY_KV_GET,
1140
+ true,
1141
+ {},
1142
+ [this, id, optional, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response resp) mutable {
1143
+ if (resp.ctx.ec == couchbase::errc::key_value::document_not_found) {
1144
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>());
1145
+ }
1146
+ if (!err) {
1147
+ // make a transaction_get_result from the row...
1148
+ try {
1149
+ if (resp.rows.empty()) {
1150
+ return op_completed_with_error(
1151
+ std::move(cb), transaction_operation_failed(FAIL_DOC_NOT_FOUND, "document not found"));
1152
+ }
1153
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "get_with_query got: {}", resp.rows.front());
1154
+ transaction_get_result doc(id, core::utils::json::parse(resp.rows.front()));
1155
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>(doc));
1156
+ } catch (const std::exception& e) {
1157
+ // TODO: unsure what to do here, but this is pretty fatal, so
1158
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1159
+ }
1160
+ }
1161
+ // for get_optional. <sigh>
1162
+ if (optional) {
1163
+ try {
1164
+ std::rethrow_exception(err);
1165
+ } catch (const document_not_found&) {
1166
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>());
1167
+ } catch (...) {
1168
+ return op_completed_with_error(std::move(cb), std::current_exception());
1169
+ }
1170
+ }
1171
+ return op_completed_with_error(std::move(cb), err);
1172
+ });
1173
+ });
1174
+ }
1175
+
1176
+ void
1177
+ attempt_context_impl::insert_raw_with_query(const core::document_id& id, const std::vector<std::byte>& content, Callback&& cb)
1178
+ {
1179
+ cache_error_async(cb, [&]() {
1180
+ std::vector<std::byte> content_copy = content;
1181
+ auto params = make_params(id, std::move(content_copy));
1182
+ couchbase::transactions::transaction_query_options opts;
1183
+ return wrap_query(KV_INSERT,
1184
+ opts,
1185
+ params,
1186
+ make_kv_txdata(),
1187
+ STAGE_QUERY_KV_INSERT,
1188
+ true,
1189
+ {},
1190
+ [this, id, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response resp) mutable {
1191
+ if (err) {
1192
+ try {
1193
+ std::rethrow_exception(err);
1194
+ } catch (const transaction_operation_failed&) {
1195
+ return op_completed_with_error(std::move(cb), err);
1196
+
1197
+ } catch (const document_exists& ex) {
1198
+ return op_completed_with_error(std::move(cb), ex);
1199
+ } catch (const std::exception& e) {
1200
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1201
+ } catch (...) {
1202
+ return op_completed_with_error(std::move(cb),
1203
+ transaction_operation_failed(FAIL_OTHER, "unexpected error"));
1204
+ }
1205
+ }
1206
+ // make a transaction_get_result from the row...
1207
+ try {
1208
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "insert_raw_with_query got: {}", resp.rows.front());
1209
+ transaction_get_result doc(id, core::utils::json::parse(resp.rows.front()));
1210
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>(doc));
1211
+ } catch (const std::exception& e) {
1212
+ // TODO: unsure what to do here, but this is pretty fatal, so
1213
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1214
+ }
1215
+ });
1216
+ });
1217
+ }
1218
+
1219
+ void
1220
+ attempt_context_impl::replace_raw_with_query(const transaction_get_result& document, const std::vector<std::byte>& content, Callback&& cb)
1221
+ {
1222
+ cache_error_async(cb, [&]() {
1223
+ std::vector<std::byte> content_copy = content;
1224
+ auto params = make_params(document.id(), std::move(content_copy));
1225
+ couchbase::transactions::transaction_query_options opts;
1226
+ return wrap_query(
1227
+ KV_REPLACE,
1228
+ opts,
1229
+ params,
1230
+ make_kv_txdata(document),
1231
+ STAGE_QUERY_KV_REPLACE,
1232
+ true,
1233
+ {},
1234
+ [this, id = document.id(), cb = std::move(cb)](std::exception_ptr err, core::operations::query_response resp) mutable {
1235
+ if (err) {
1236
+ try {
1237
+ std::rethrow_exception(err);
1238
+ } catch (const query_cas_mismatch& e) {
1239
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_CAS_MISMATCH, e.what()).retry());
1240
+ } catch (const document_not_found& e) {
1241
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_DOC_NOT_FOUND, e.what()).retry());
1242
+ } catch (const transaction_operation_failed& e) {
1243
+ return op_completed_with_error(std::move(cb), e);
1244
+ } catch (std::exception& e) {
1245
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1246
+ } catch (...) {
1247
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, "unexpected exception"));
1248
+ }
1249
+ }
1250
+ // make a transaction_get_result from the row...
1251
+ try {
1252
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "replace_raw_with_query got: {}", resp.rows.front());
1253
+ transaction_get_result doc(id, core::utils::json::parse(resp.rows.front()));
1254
+ return op_completed_with_callback(std::move(cb), std::optional<transaction_get_result>(doc));
1255
+ } catch (const std::exception& e) {
1256
+ // TODO: unsure what to do here, but this is pretty fatal, so
1257
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1258
+ }
1259
+ });
1260
+ });
1261
+ }
1262
+
1263
+ void
1264
+ attempt_context_impl::remove_with_query(const transaction_get_result& document, VoidCallback&& cb)
1265
+ {
1266
+ cache_error_async(cb, [&]() {
1267
+ auto params = make_params(document.id(), {});
1268
+ couchbase::transactions::transaction_query_options opts;
1269
+ return wrap_query(
1270
+ KV_REMOVE,
1271
+ opts,
1272
+ params,
1273
+ make_kv_txdata(document),
1274
+ STAGE_QUERY_KV_REMOVE,
1275
+ true,
1276
+ {},
1277
+ [this, id = document.id(), cb = std::move(cb)](std::exception_ptr err, core::operations::query_response /* resp */) mutable {
1278
+ if (err) {
1279
+ try {
1280
+ std::rethrow_exception(err);
1281
+ } catch (const transaction_operation_failed& e) {
1282
+ return op_completed_with_error(std::move(cb), e);
1283
+ } catch (const document_not_found& e) {
1284
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_DOC_NOT_FOUND, e.what()).retry());
1285
+ } catch (const query_cas_mismatch& e) {
1286
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_CAS_MISMATCH, e.what()).retry());
1287
+ } catch (const std::exception& e) {
1288
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, e.what()));
1289
+ } catch (...) {
1290
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_OTHER, "unexpected exception"));
1291
+ }
1292
+ }
1293
+ // make a transaction_get_result from the row...
1294
+ return op_completed_with_callback(std::move(cb));
1295
+ });
1296
+ });
1297
+ }
1298
+
1299
+ void
1300
+ attempt_context_impl::commit_with_query(VoidCallback&& cb)
1301
+ {
1302
+ core::operations::query_request req;
1303
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "commit_with_query called");
1304
+ couchbase::transactions::transaction_query_options opts;
1305
+ std::vector<core::json_string> params;
1306
+ wrap_query(
1307
+ COMMIT,
1308
+ opts,
1309
+ params,
1310
+ make_kv_txdata(std::nullopt),
1311
+ STAGE_QUERY_COMMIT,
1312
+ true,
1313
+ {},
1314
+ [this, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response /* resp */) mutable {
1315
+ is_done_ = true;
1316
+ if (err) {
1317
+ try {
1318
+ std::rethrow_exception(err);
1319
+ } catch (const transaction_operation_failed&) {
1320
+ return cb(std::current_exception());
1321
+ } catch (const query_attempt_expired& e) {
1322
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_EXPIRY, e.what()).ambiguous().no_rollback()));
1323
+ } catch (const document_not_found& e) {
1324
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_DOC_NOT_FOUND, e.what()).no_rollback()));
1325
+ } catch (const document_exists& e) {
1326
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_DOC_ALREADY_EXISTS, e.what()).no_rollback()));
1327
+ } catch (const query_cas_mismatch& e) {
1328
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_CAS_MISMATCH, e.what()).no_rollback()));
1329
+ } catch (const std::exception& e) {
1330
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, e.what()).no_rollback()));
1331
+ }
1332
+ }
1333
+ state(attempt_state::COMPLETED);
1334
+ return cb({});
1335
+ });
1336
+ }
1337
+ void
1338
+ attempt_context_impl::rollback_with_query(VoidCallback&& cb)
1339
+ {
1340
+ core::operations::query_request req;
1341
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "rollback_with_query called");
1342
+ couchbase::transactions::transaction_query_options opts;
1343
+ std::vector<core::json_string> params;
1344
+ wrap_query(ROLLBACK,
1345
+ opts,
1346
+ params,
1347
+ make_kv_txdata(std::nullopt),
1348
+ STAGE_QUERY_ROLLBACK,
1349
+ true,
1350
+ {},
1351
+ [this, cb = std::move(cb)](std::exception_ptr err, core::operations::query_response /* resp */) mutable {
1352
+ is_done_ = true;
1353
+ if (err) {
1354
+ try {
1355
+ std::rethrow_exception(err);
1356
+ } catch (const transaction_operation_failed&) {
1357
+ return cb(std::current_exception());
1358
+ } catch (const query_attempt_not_found& e) {
1359
+ CB_ATTEMPT_CTX_LOG_DEBUG(
1360
+ this, "got query_attempt_not_found, assuming query was already rolled back successfullly: {}", e.what());
1361
+ } catch (const std::exception& e) {
1362
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, e.what()).no_rollback()));
1363
+ }
1364
+ }
1365
+ state(attempt_state::ROLLED_BACK);
1366
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "rollback successful");
1367
+ return cb({});
1368
+ });
1369
+ }
1370
+ void
1371
+ attempt_context_impl::atr_commit(bool ambiguity_resolution_mode)
1372
+ {
1373
+ retry_op<void>([this, &ambiguity_resolution_mode]() {
1374
+ try {
1375
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + id() + ".");
1376
+ core::operations::mutate_in_request req{ atr_id_.value() };
1377
+ req.specs =
1378
+ couchbase::mutate_in_specs{
1379
+ couchbase::mutate_in_specs::upsert(prefix + ATR_FIELD_STATUS, attempt_state_name(attempt_state::COMMITTED)).xattr(),
1380
+ couchbase::mutate_in_specs::upsert(prefix + ATR_FIELD_START_COMMIT, subdoc::mutate_in_macro::cas).xattr(),
1381
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_PREVENT_COLLLISION, 0).xattr(),
1382
+ }
1383
+ .specs();
1384
+ wrap_durable_request(req, overall_.config());
1385
+ auto ec = error_if_expired_and_not_in_overtime(STAGE_ATR_COMMIT, {});
1386
+ if (ec) {
1387
+ throw client_error(*ec, "atr_commit check for expiry threw error");
1388
+ }
1389
+ if (!!(ec = hooks_.before_atr_commit(this))) {
1390
+ // for now, throw. Later, if this is async, we will use error handler no doubt.
1391
+ throw client_error(*ec, "before_atr_commit hook raised error");
1392
+ }
1393
+ staged_mutations_->extract_to(prefix, req);
1394
+ auto barrier = std::make_shared<std::promise<result>>();
1395
+ auto f = barrier->get_future();
1396
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "updating atr {}, setting to {}", req.id, attempt_state_name(attempt_state::COMMITTED));
1397
+ overall_.cluster_ref()->execute(
1398
+ req, [barrier](core::operations::mutate_in_response resp) { barrier->set_value(result::create_from_subdoc_response(resp)); });
1399
+ auto res = wrap_operation_future(f, false);
1400
+ ec = hooks_.after_atr_commit(this);
1401
+ if (ec) {
1402
+ throw client_error(*ec, "after_atr_commit hook raised error");
1403
+ }
1404
+ state(attempt_state::COMMITTED);
1405
+ } catch (const client_error& e) {
1406
+ error_class ec = e.ec();
1407
+ switch (ec) {
1408
+ case FAIL_EXPIRY: {
1409
+ expiry_overtime_mode_ = true;
1410
+ auto out = transaction_operation_failed(ec, e.what()).no_rollback();
1411
+ if (ambiguity_resolution_mode) {
1412
+ out.ambiguous();
1413
+ } else {
1414
+ out.expired();
1415
+ }
1416
+ throw out;
1417
+ }
1418
+ case FAIL_AMBIGUOUS:
1419
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_commit got FAIL_AMBIGUOUS, resolving ambiguity...");
1420
+ ambiguity_resolution_mode = true;
1421
+ throw retry_operation(e.what());
1422
+ case FAIL_TRANSIENT:
1423
+ if (ambiguity_resolution_mode) {
1424
+ throw retry_operation(e.what());
1425
+ }
1426
+ throw transaction_operation_failed(ec, e.what()).retry();
1427
+
1428
+ case FAIL_PATH_ALREADY_EXISTS:
1429
+ // Need retry_op as atr_commit_ambiguity_resolution can throw retry_operation
1430
+ return retry_op<void>([&]() { return atr_commit_ambiguity_resolution(); });
1431
+ case FAIL_HARD: {
1432
+ auto out = transaction_operation_failed(ec, e.what()).no_rollback();
1433
+ if (ambiguity_resolution_mode) {
1434
+ out.ambiguous();
1435
+ }
1436
+ throw out;
1437
+ }
1438
+ case FAIL_DOC_NOT_FOUND: {
1439
+ auto out = transaction_operation_failed(ec, e.what())
1440
+ .cause(external_exception::ACTIVE_TRANSACTION_RECORD_NOT_FOUND)
1441
+ .no_rollback();
1442
+ if (ambiguity_resolution_mode) {
1443
+ out.ambiguous();
1444
+ }
1445
+ throw out;
1446
+ }
1447
+ case FAIL_PATH_NOT_FOUND: {
1448
+ auto out = transaction_operation_failed(ec, e.what())
1449
+ .cause(external_exception::ACTIVE_TRANSACTION_RECORD_ENTRY_NOT_FOUND)
1450
+ .no_rollback();
1451
+ if (ambiguity_resolution_mode) {
1452
+ out.ambiguous();
1453
+ }
1454
+ throw out;
1455
+ }
1456
+ case FAIL_ATR_FULL: {
1457
+ auto out =
1458
+ transaction_operation_failed(ec, e.what()).cause(external_exception::ACTIVE_TRANSACTION_RECORD_FULL).no_rollback();
1459
+ if (ambiguity_resolution_mode) {
1460
+ out.ambiguous();
1461
+ }
1462
+ throw out;
1463
+ }
1464
+ default: {
1465
+ CB_ATTEMPT_CTX_LOG_ERROR(this,
1466
+ "failed to commit transaction {}, attempt {}, ambiguity_resolution_mode {}, with error {}",
1467
+ transaction_id(),
1468
+ id(),
1469
+ ambiguity_resolution_mode,
1470
+ e.what());
1471
+ auto out = transaction_operation_failed(ec, e.what());
1472
+ if (ambiguity_resolution_mode) {
1473
+ out.no_rollback().ambiguous();
1474
+ }
1475
+ throw out;
1476
+ }
1477
+ }
1478
+ }
1479
+ });
1480
+ }
1481
+
1482
+ void
1483
+ attempt_context_impl::atr_commit_ambiguity_resolution()
1484
+ {
1485
+ try {
1486
+ auto ec = error_if_expired_and_not_in_overtime(STAGE_ATR_COMMIT_AMBIGUITY_RESOLUTION, {});
1487
+ if (ec) {
1488
+ throw client_error(*ec, "atr_commit_ambiguity_resolution raised error");
1489
+ }
1490
+ if (!!(ec = hooks_.before_atr_commit_ambiguity_resolution(this))) {
1491
+ throw client_error(*ec, "before_atr_commit_ambiguity_resolution hook threw error");
1492
+ }
1493
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + id() + ".");
1494
+ core::operations::lookup_in_request req{ atr_id_.value() };
1495
+ req.specs = lookup_in_specs{ lookup_in_specs::get(prefix + ATR_FIELD_STATUS).xattr() }.specs();
1496
+ wrap_request(req, overall_.config());
1497
+ auto barrier = std::make_shared<std::promise<result>>();
1498
+ auto f = barrier->get_future();
1499
+ overall_.cluster_ref()->execute(
1500
+ req, [barrier](core::operations::lookup_in_response resp) { barrier->set_value(result::create_from_subdoc_response(resp)); });
1501
+ auto res = wrap_operation_future(f);
1502
+ auto atr_status_raw = res.values[0].content_as<std::string>();
1503
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_commit_ambiguity_resolution read atr state {}", atr_status_raw);
1504
+ auto atr_status = attempt_state_value(atr_status_raw);
1505
+ switch (atr_status) {
1506
+ case attempt_state::COMMITTED:
1507
+ return;
1508
+ case attempt_state::ABORTED:
1509
+ // aborted by another process?
1510
+ throw transaction_operation_failed(FAIL_OTHER, "transaction aborted externally").retry();
1511
+ default:
1512
+ throw transaction_operation_failed(FAIL_OTHER, "unexpected state found on ATR ambiguity resolution")
1513
+ .cause(ILLEGAL_STATE_EXCEPTION)
1514
+ .no_rollback();
1515
+ }
1516
+ } catch (const client_error& e) {
1517
+ error_class ec = e.ec();
1518
+ switch (ec) {
1519
+ case FAIL_EXPIRY:
1520
+ throw transaction_operation_failed(ec, e.what()).no_rollback().ambiguous();
1521
+ case FAIL_HARD:
1522
+ throw transaction_operation_failed(ec, e.what()).no_rollback().ambiguous();
1523
+ case FAIL_TRANSIENT:
1524
+ case FAIL_OTHER:
1525
+ throw retry_operation(e.what());
1526
+ case FAIL_PATH_NOT_FOUND:
1527
+ throw transaction_operation_failed(ec, e.what()).cause(ACTIVE_TRANSACTION_RECORD_ENTRY_NOT_FOUND).no_rollback().ambiguous();
1528
+ case FAIL_DOC_NOT_FOUND:
1529
+ throw transaction_operation_failed(ec, e.what()).cause(ACTIVE_TRANSACTION_RECORD_NOT_FOUND).no_rollback().ambiguous();
1530
+ default:
1531
+ throw transaction_operation_failed(ec, e.what()).no_rollback().ambiguous();
1532
+ }
1533
+ }
1534
+ }
1535
+
1536
+ void
1537
+ attempt_context_impl::atr_complete()
1538
+ {
1539
+ try {
1540
+ result atr_res;
1541
+ auto ec = hooks_.before_atr_complete(this);
1542
+ if (ec) {
1543
+ throw client_error(*ec, "before_atr_complete hook threw error");
1544
+ }
1545
+ // if we have expired (and not in overtime mode), just raise the final error.
1546
+ if (!!(ec = error_if_expired_and_not_in_overtime(STAGE_ATR_COMPLETE, {}))) {
1547
+ throw client_error(*ec, "atr_complete threw error");
1548
+ }
1549
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "removing attempt {} from atr", atr_id_.value());
1550
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + id());
1551
+ core::operations::mutate_in_request req{ atr_id_.value() };
1552
+ req.specs =
1553
+ couchbase::mutate_in_specs{
1554
+ couchbase::mutate_in_specs::remove(prefix).xattr(),
1555
+ }
1556
+ .specs();
1557
+ wrap_durable_request(req, overall_.config());
1558
+ auto barrier = std::make_shared<std::promise<result>>();
1559
+ auto f = barrier->get_future();
1560
+ overall_.cluster_ref()->execute(
1561
+ req, [barrier](core::operations::mutate_in_response resp) { barrier->set_value(result::create_from_subdoc_response(resp)); });
1562
+ wrap_operation_future(f);
1563
+ ec = hooks_.after_atr_complete(this);
1564
+ if (ec) {
1565
+ throw client_error(*ec, "after_atr_complete hook threw error");
1566
+ }
1567
+ state(attempt_state::COMPLETED);
1568
+ } catch (const client_error& er) {
1569
+ error_class ec = er.ec();
1570
+ switch (ec) {
1571
+ case FAIL_HARD:
1572
+ throw transaction_operation_failed(ec, er.what()).no_rollback().failed_post_commit();
1573
+ default:
1574
+ CB_ATTEMPT_CTX_LOG_INFO(this, "ignoring error in atr_complete {}", er.what());
1575
+ }
1576
+ }
1577
+ }
1578
+ void
1579
+ attempt_context_impl::commit(VoidCallback&& cb)
1580
+ {
1581
+ // for now, lets keep the blocking implementation
1582
+ std::thread([cb = std::move(cb), this]() mutable {
1583
+ try {
1584
+ commit();
1585
+ return cb({});
1586
+ } catch (const transaction_operation_failed&) {
1587
+ return cb(std::current_exception());
1588
+ } catch (const std::exception& e) {
1589
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, e.what())));
1590
+ }
1591
+ }).detach();
1592
+ }
1593
+
1594
+ void
1595
+ attempt_context_impl::commit()
1596
+ {
1597
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "waiting on ops to finish...");
1598
+ op_list_.wait_and_block_ops();
1599
+ existing_error(false);
1600
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "commit {}", id());
1601
+ if (op_list_.get_mode().is_query()) {
1602
+ auto barrier = std::make_shared<std::promise<void>>();
1603
+ auto f = barrier->get_future();
1604
+ commit_with_query([barrier](std::exception_ptr err) {
1605
+ if (err) {
1606
+ barrier->set_exception(err);
1607
+ } else {
1608
+ barrier->set_value();
1609
+ }
1610
+ });
1611
+ f.get();
1612
+ } else {
1613
+ if (check_expiry_pre_commit(STAGE_BEFORE_COMMIT, {})) {
1614
+ throw transaction_operation_failed(FAIL_EXPIRY, "transaction expired").expired();
1615
+ }
1616
+ if (atr_id_ && !atr_id_->key().empty() && !is_done_) {
1617
+ retry_op_exp<void>([&]() { atr_commit(false); });
1618
+ staged_mutations_->commit(this);
1619
+ atr_complete();
1620
+ is_done_ = true;
1621
+ } else {
1622
+ // no mutation, no need to commit
1623
+ if (!is_done_) {
1624
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "calling commit on attempt that has got no mutations, skipping");
1625
+ is_done_ = true;
1626
+ return;
1627
+ } // do not rollback or retry
1628
+ throw transaction_operation_failed(FAIL_OTHER, "calling commit on attempt that is already completed").no_rollback();
1629
+ }
1630
+ }
1631
+ }
1632
+
1633
+ void
1634
+ attempt_context_impl::atr_abort()
1635
+ {
1636
+ try {
1637
+ auto ec = error_if_expired_and_not_in_overtime(STAGE_ATR_ABORT, {});
1638
+ if (ec) {
1639
+ throw client_error(*ec, "atr_abort check for expiry threw error");
1640
+ }
1641
+ if (!!(ec = hooks_.before_atr_aborted(this))) {
1642
+ throw client_error(*ec, "before_atr_aborted hook threw error");
1643
+ }
1644
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + id() + ".");
1645
+ core::operations::mutate_in_request req{ atr_id_.value() };
1646
+ req.specs =
1647
+ couchbase::mutate_in_specs{
1648
+ couchbase::mutate_in_specs::upsert(prefix + ATR_FIELD_STATUS, attempt_state_name(attempt_state::ABORTED))
1649
+ .xattr()
1650
+ .create_path(),
1651
+ couchbase::mutate_in_specs::upsert(prefix + ATR_FIELD_TIMESTAMP_ROLLBACK_START, subdoc::mutate_in_macro::cas)
1652
+ .xattr()
1653
+ .create_path(),
1654
+ }
1655
+ .specs();
1656
+ staged_mutations_->extract_to(prefix, req);
1657
+ wrap_durable_request(req, overall_.config());
1658
+ auto barrier = std::make_shared<std::promise<result>>();
1659
+ auto f = barrier->get_future();
1660
+ overall_.cluster_ref()->execute(
1661
+ req, [barrier](core::operations::mutate_in_response resp) { barrier->set_value(result::create_from_subdoc_response(resp)); });
1662
+ wrap_operation_future(f);
1663
+ state(attempt_state::ABORTED);
1664
+ ec = hooks_.after_atr_aborted(this);
1665
+ if (ec) {
1666
+ throw client_error(*ec, "after_atr_aborted hook threw error");
1667
+ }
1668
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "rollback completed atr abort phase");
1669
+ } catch (const client_error& e) {
1670
+ auto ec = e.ec();
1671
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "atr_abort got {} {}", ec, e.what());
1672
+ if (expiry_overtime_mode_.load()) {
1673
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_abort got error \"{}\" while in overtime mode", e.what());
1674
+ throw transaction_operation_failed(FAIL_EXPIRY, std::string("expired in atr_abort with {} ") + e.what())
1675
+ .no_rollback()
1676
+ .expired();
1677
+ }
1678
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_abort got error {}", ec);
1679
+ switch (ec) {
1680
+ case FAIL_EXPIRY:
1681
+ expiry_overtime_mode_ = true;
1682
+ throw retry_operation("expired, setting overtime mode and retry atr_abort");
1683
+ case FAIL_PATH_NOT_FOUND:
1684
+ throw transaction_operation_failed(ec, e.what()).no_rollback().cause(ACTIVE_TRANSACTION_RECORD_ENTRY_NOT_FOUND);
1685
+ case FAIL_DOC_NOT_FOUND:
1686
+ throw transaction_operation_failed(ec, e.what()).no_rollback().cause(ACTIVE_TRANSACTION_RECORD_NOT_FOUND);
1687
+ case FAIL_ATR_FULL:
1688
+ throw transaction_operation_failed(ec, e.what()).no_rollback().cause(ACTIVE_TRANSACTION_RECORD_FULL);
1689
+ case FAIL_HARD:
1690
+ throw transaction_operation_failed(ec, e.what()).no_rollback();
1691
+ default:
1692
+ throw retry_operation("retry atr_abort");
1693
+ }
1694
+ }
1695
+ }
1696
+
1697
+ void
1698
+ attempt_context_impl::atr_rollback_complete()
1699
+ {
1700
+ try {
1701
+ auto ec = error_if_expired_and_not_in_overtime(STAGE_ATR_ROLLBACK_COMPLETE, std::nullopt);
1702
+ if (ec) {
1703
+ throw client_error(*ec, "atr_rollback_complete raised error");
1704
+ }
1705
+ if (!!(ec = hooks_.before_atr_rolled_back(this))) {
1706
+ throw client_error(*ec, "before_atr_rolled_back hook threw error");
1707
+ }
1708
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + id());
1709
+ core::operations::mutate_in_request req{ atr_id_.value() };
1710
+ req.specs =
1711
+ couchbase::mutate_in_specs{
1712
+ couchbase::mutate_in_specs::remove(prefix).xattr(),
1713
+ }
1714
+ .specs();
1715
+ wrap_durable_request(req, overall_.config());
1716
+ auto barrier = std::make_shared<std::promise<result>>();
1717
+ auto f = barrier->get_future();
1718
+ overall_.cluster_ref()->execute(
1719
+ req, [barrier](core::operations::mutate_in_response resp) { barrier->set_value(result::create_from_subdoc_response(resp)); });
1720
+ wrap_operation_future(f);
1721
+ state(attempt_state::ROLLED_BACK);
1722
+ ec = hooks_.after_atr_rolled_back(this);
1723
+ if (ec) {
1724
+ throw client_error(*ec, "after_atr_rolled_back hook threw error");
1725
+ }
1726
+ is_done_ = true;
1727
+
1728
+ } catch (const client_error& e) {
1729
+ auto ec = e.ec();
1730
+ if (expiry_overtime_mode_.load()) {
1731
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_rollback_complete error while in overtime mode {}", e.what());
1732
+ throw transaction_operation_failed(FAIL_EXPIRY, std::string("expired in atr_rollback_complete with {} ") + e.what())
1733
+ .no_rollback()
1734
+ .expired();
1735
+ }
1736
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr_rollback_complete got error {}", ec);
1737
+ switch (ec) {
1738
+ case FAIL_DOC_NOT_FOUND:
1739
+ case FAIL_PATH_NOT_FOUND:
1740
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr {} not found, ignoring", atr_id_->key());
1741
+ is_done_ = true;
1742
+ break;
1743
+ case FAIL_ATR_FULL:
1744
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "atr {} full!", atr_id_->key());
1745
+ throw retry_operation(e.what());
1746
+ case FAIL_HARD:
1747
+ throw transaction_operation_failed(ec, e.what()).no_rollback();
1748
+ case FAIL_EXPIRY:
1749
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "timed out writing atr {}", atr_id_->key());
1750
+ throw transaction_operation_failed(ec, e.what()).no_rollback().expired();
1751
+ default:
1752
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "retrying atr_rollback_complete");
1753
+ throw retry_operation(e.what());
1754
+ }
1755
+ }
1756
+ }
1757
+ void
1758
+ attempt_context_impl::rollback(VoidCallback&& cb)
1759
+ {
1760
+ // for now, lets keep the blocking implementation
1761
+ std::thread([cb = std::move(cb), this]() mutable {
1762
+ if (op_list_.get_mode().is_query()) {
1763
+ return rollback_with_query(std::move(cb));
1764
+ }
1765
+ try {
1766
+ rollback();
1767
+ return cb({});
1768
+ } catch (const transaction_operation_failed&) {
1769
+ return cb(std::current_exception());
1770
+ } catch (const std::exception& e) {
1771
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, e.what()).no_rollback()));
1772
+ } catch (...) {
1773
+ return cb(std::make_exception_ptr(transaction_operation_failed(FAIL_OTHER, "unexpected exception during rollback")));
1774
+ }
1775
+ }).detach();
1776
+ }
1777
+
1778
+ void
1779
+ attempt_context_impl::rollback()
1780
+ {
1781
+ op_list_.wait_and_block_ops();
1782
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "rolling back {}", id());
1783
+ if (op_list_.get_mode().is_query()) {
1784
+ auto barrier = std::make_shared<std::promise<void>>();
1785
+ auto f = barrier->get_future();
1786
+ rollback_with_query([barrier](std::exception_ptr err) {
1787
+ if (err) {
1788
+ barrier->set_exception(err);
1789
+ } else {
1790
+ barrier->set_value();
1791
+ }
1792
+ });
1793
+ return f.get();
1794
+ }
1795
+ // check for expiry
1796
+ check_expiry_during_commit_or_rollback(STAGE_ROLLBACK, std::nullopt);
1797
+ if (!atr_id_ || atr_id_->key().empty() || state() == attempt_state::NOT_STARTED) {
1798
+ // TODO: check this, but if we try to rollback an empty txn, we should prevent a subsequent commit
1799
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "rollback called on txn with no mutations");
1800
+ is_done_ = true;
1801
+ return;
1802
+ }
1803
+ if (is_done()) {
1804
+ std::string msg("Transaction already done, cannot rollback");
1805
+ CB_ATTEMPT_CTX_LOG_ERROR(this, msg);
1806
+ // need to raise a FAIL_OTHER which is not retryable or rollback-able
1807
+ throw transaction_operation_failed(FAIL_OTHER, msg).no_rollback();
1808
+ }
1809
+ try {
1810
+ // (1) atr_abort
1811
+ retry_op_exp<void>([&]() { atr_abort(); });
1812
+ // (2) rollback staged mutations
1813
+ staged_mutations_->rollback(this);
1814
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "rollback completed unstaging docs");
1815
+
1816
+ // (3) atr_rollback
1817
+ retry_op_exp<void>([&]() { atr_rollback_complete(); });
1818
+ } catch (const client_error& e) {
1819
+ error_class ec = e.ec();
1820
+ CB_ATTEMPT_CTX_LOG_ERROR(this, "rollback transaction {}, attempt {} fail with error {}", transaction_id(), id(), e.what());
1821
+ if (ec == FAIL_HARD) {
1822
+ throw transaction_operation_failed(ec, e.what()).no_rollback();
1823
+ }
1824
+ }
1825
+ }
1826
+
1827
+ bool
1828
+ attempt_context_impl::has_expired_client_side(std::string place, std::optional<const std::string> doc_id)
1829
+ {
1830
+ bool over = overall_.has_expired_client_side();
1831
+ bool hook = hooks_.has_expired_client_side(this, place, doc_id);
1832
+ if (over) {
1833
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "{} expired in {}", id(), place);
1834
+ }
1835
+ if (hook) {
1836
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "{} fake expiry in {}", id(), place);
1837
+ }
1838
+ return over || hook;
1839
+ }
1840
+
1841
+ bool
1842
+ attempt_context_impl::check_expiry_pre_commit(std::string stage, std::optional<const std::string> doc_id)
1843
+ {
1844
+ if (has_expired_client_side(stage, std::move(doc_id))) {
1845
+ CB_ATTEMPT_CTX_LOG_DEBUG(
1846
+ this, "{} has expired in stage {}, entering expiry-overtime mode - will make one attempt to rollback", id(), stage);
1847
+
1848
+ // [EXP-ROLLBACK] Combo of setting this mode and throwing AttemptExpired will result in an attempt to rollback, which will
1849
+ // ignore expiry, and bail out if anything fails
1850
+ expiry_overtime_mode_ = true;
1851
+ return true;
1852
+ }
1853
+ return false;
1854
+ }
1855
+
1856
+ std::optional<error_class>
1857
+ attempt_context_impl::error_if_expired_and_not_in_overtime(const std::string& stage, std::optional<const std::string> doc_id)
1858
+ {
1859
+ if (expiry_overtime_mode_.load()) {
1860
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "not doing expired check in {} as already in expiry-overtime", stage);
1861
+ return {};
1862
+ }
1863
+ if (has_expired_client_side(stage, std::move(doc_id))) {
1864
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "expired in {}", stage);
1865
+ return FAIL_EXPIRY;
1866
+ }
1867
+ return {};
1868
+ }
1869
+
1870
+ void
1871
+ attempt_context_impl::check_expiry_during_commit_or_rollback(const std::string& stage, std::optional<const std::string> doc_id)
1872
+ {
1873
+ // [EXP-COMMIT-OVERTIME]
1874
+ if (!expiry_overtime_mode_.load()) {
1875
+ if (has_expired_client_side(stage, std::move(doc_id))) {
1876
+ CB_ATTEMPT_CTX_LOG_DEBUG(
1877
+ this, "{} has expired in stage {}, entering expiry-overtime mode (one attempt to complete commit)", id(), stage);
1878
+ expiry_overtime_mode_ = true;
1879
+ }
1880
+ } else {
1881
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "{} ignoring expiry in stage {} as in expiry-overtime mode", id(), stage);
1882
+ }
1883
+ }
1884
+ template<typename Handler>
1885
+ void
1886
+ attempt_context_impl::set_atr_pending_locked(const core::document_id& id, std::unique_lock<std::mutex>&& lock, Handler&& fn)
1887
+ {
1888
+ try {
1889
+ if (staged_mutations_->empty()) {
1890
+ std::string prefix(ATR_FIELD_ATTEMPTS + "." + this->id() + ".");
1891
+ if (!atr_id_) {
1892
+ return fn(transaction_operation_failed(FAIL_OTHER, std::string("ATR ID is not initialized")));
1893
+ }
1894
+ if (auto ec = error_if_expired_and_not_in_overtime(STAGE_ATR_PENDING, {})) {
1895
+ return fn(transaction_operation_failed(*ec, "transaction expired setting ATR").expired());
1896
+ }
1897
+ auto error_handler =
1898
+ [this, &lock](error_class ec, const std::string& message, const core::document_id& doc_id, Handler&& fn) mutable {
1899
+ transaction_operation_failed err(ec, message);
1900
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "got {} trying to set atr to pending", message);
1901
+ if (expiry_overtime_mode_.load()) {
1902
+ return fn(err.no_rollback().expired());
1903
+ }
1904
+ switch (ec) {
1905
+ case FAIL_EXPIRY:
1906
+ expiry_overtime_mode_ = true;
1907
+ // this should trigger rollback (unlike the above when already in overtime mode)
1908
+ return fn(err.expired());
1909
+ case FAIL_ATR_FULL:
1910
+ return fn(err);
1911
+ case FAIL_PATH_ALREADY_EXISTS:
1912
+ // assuming this got resolved, moving on as if ok
1913
+ return fn(std::nullopt);
1914
+ case FAIL_AMBIGUOUS:
1915
+ // Retry just this
1916
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "got FAIL_AMBIGUOUS, retrying set atr pending", ec);
1917
+ return overall_.after_delay(std::chrono::milliseconds(1), [this, doc_id, &lock, fn = std::move(fn)]() {
1918
+ set_atr_pending_locked(doc_id, std::move(lock), std::move(fn));
1919
+ });
1920
+ case FAIL_TRANSIENT:
1921
+ // Retry txn
1922
+ return fn(err.retry());
1923
+ case FAIL_HARD:
1924
+ return fn(err.no_rollback());
1925
+ default:
1926
+ return fn(err);
1927
+ }
1928
+ };
1929
+ if (auto ec = hooks_.before_atr_pending(this); ec) {
1930
+ return error_handler(*ec, "before_atr_pending hook raised error", id, std::forward<Handler>(fn));
1931
+ }
1932
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "updating atr {}", atr_id_.value());
1933
+
1934
+ std::chrono::nanoseconds remaining = overall_.remaining();
1935
+ // This bounds the value to [0-expirationTime]. It should always be in this range, this is just to protect
1936
+ // against the application clock changing.
1937
+ long remaining_bounded_nanos = std::max(std::min(remaining.count(), overall_.config().expiration_time.count()),
1938
+ static_cast<std::chrono::nanoseconds::rep>(0));
1939
+ long remaining_bounded_msecs = remaining_bounded_nanos / 1'000'000;
1940
+
1941
+ core::operations::mutate_in_request req{ atr_id_.value() };
1942
+
1943
+ req.specs =
1944
+ couchbase::mutate_in_specs{
1945
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_TRANSACTION_ID, overall_.transaction_id()).xattr().create_path(),
1946
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_STATUS, attempt_state_name(attempt_state::PENDING))
1947
+ .xattr()
1948
+ .create_path(),
1949
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_START_TIMESTAMP, subdoc::mutate_in_macro::cas)
1950
+ .xattr()
1951
+ .create_path(),
1952
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_EXPIRES_AFTER_MSECS, remaining_bounded_msecs).xattr().create_path(),
1953
+ // ExtStoreDurability
1954
+ couchbase::mutate_in_specs::insert(prefix + ATR_FIELD_DURABILITY_LEVEL,
1955
+ store_durability_level_to_string(overall_.config().level))
1956
+ .xattr()
1957
+ .create_path(),
1958
+ // subdoc::opcode::set_doc used in replace w/ empty path
1959
+ // ExtBinaryMetadata
1960
+ couchbase::mutate_in_specs::replace_raw({}, std::vector<std::byte>{ std::byte{ 0x00 } }),
1961
+ }
1962
+ .specs();
1963
+ req.store_semantics = couchbase::store_semantics::upsert;
1964
+
1965
+ wrap_durable_request(req, overall_.config());
1966
+ overall_.cluster_ref()->execute(
1967
+ req, [this, fn = std::forward<Handler>(fn), error_handler](core::operations::mutate_in_response resp) mutable {
1968
+ auto ec = error_class_from_response(resp);
1969
+ if (!ec) {
1970
+ ec = hooks_.after_atr_pending(this);
1971
+ }
1972
+ if (!ec) {
1973
+ state(attempt_state::PENDING);
1974
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "set ATR {} to Pending, got CAS (start time) {}", atr_id_.value(), resp.cas.value());
1975
+ return fn(std::nullopt);
1976
+ }
1977
+ return error_handler(*ec,
1978
+ resp.ctx.ec().message(),
1979
+ { resp.ctx.bucket(), resp.ctx.scope(), resp.ctx.collection(), resp.ctx.id() },
1980
+ std::forward<Handler>(fn));
1981
+ });
1982
+ }
1983
+ } catch (const std::exception& e) {
1984
+ CB_ATTEMPT_CTX_LOG_ERROR(this, "unexpected error setting atr pending {}", e.what());
1985
+ return fn(transaction_operation_failed(FAIL_OTHER, "unexpected error setting atr pending"));
1986
+ }
1987
+ }
1988
+
1989
+ staged_mutation*
1990
+ attempt_context_impl::check_for_own_write(const core::document_id& id)
1991
+ {
1992
+ staged_mutation* own_replace = staged_mutations_->find_replace(id);
1993
+ if (own_replace != nullptr) {
1994
+ return own_replace;
1995
+ }
1996
+ staged_mutation* own_insert = staged_mutations_->find_insert(id);
1997
+ if (own_insert != nullptr) {
1998
+ return own_insert;
1999
+ }
2000
+ return nullptr;
2001
+ }
2002
+
2003
+ template<typename Handler>
2004
+ void
2005
+ attempt_context_impl::check_if_done(Handler& cb)
2006
+ {
2007
+ if (is_done_) {
2008
+ return op_completed_with_error(
2009
+ std::move(cb),
2010
+ transaction_operation_failed(FAIL_OTHER, "Cannot perform operations after transaction has been committed or rolled back")
2011
+ .no_rollback());
2012
+ }
2013
+ }
2014
+ template<typename Handler>
2015
+ void
2016
+ attempt_context_impl::do_get(const core::document_id& id, const std::optional<std::string> resolving_missing_atr_entry, Handler&& cb)
2017
+ {
2018
+ try {
2019
+ if (check_expiry_pre_commit(STAGE_GET, id.key())) {
2020
+ return cb(FAIL_EXPIRY, "expired in do_get", std::nullopt);
2021
+ }
2022
+
2023
+ staged_mutation* own_write = check_for_own_write(id);
2024
+ if (own_write) {
2025
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found own-write of mutated doc {}", id);
2026
+ return cb(std::nullopt, std::nullopt, transaction_get_result::create_from(own_write->doc(), own_write->content()));
2027
+ }
2028
+ staged_mutation* own_remove = staged_mutations_->find_remove(id);
2029
+ if (own_remove) {
2030
+ auto msg = fmt::format("found own-write of removed doc {}", id);
2031
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, msg);
2032
+ return cb(FAIL_DOC_NOT_FOUND, msg, std::nullopt);
2033
+ }
2034
+
2035
+ if (auto ec = hooks_.before_doc_get(this, id.key()); ec) {
2036
+ return cb(ec, "before_doc_get hook raised error", std::nullopt);
2037
+ }
2038
+
2039
+ get_doc(
2040
+ id,
2041
+ [this, id, resolving_missing_atr_entry = std::move(resolving_missing_atr_entry), cb = std::move(cb)](
2042
+ std::optional<error_class> ec, std::optional<std::string> err_message, std::optional<transaction_get_result> doc) mutable {
2043
+ if (!ec && !doc) {
2044
+ // it just isn't there.
2045
+ return cb(std::nullopt, std::nullopt, std::nullopt);
2046
+ }
2047
+ if (!ec) {
2048
+ if (doc->links().is_document_in_transaction()) {
2049
+ CB_ATTEMPT_CTX_LOG_DEBUG(
2050
+ this, "doc {} in transaction, resolving_missing_atr_entry={}", *doc, resolving_missing_atr_entry.value_or("-"));
2051
+
2052
+ if (resolving_missing_atr_entry.has_value() &&
2053
+ resolving_missing_atr_entry.value() == doc->links().staged_attempt_id()) {
2054
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "doc is in lost pending transaction");
2055
+
2056
+ if (doc->links().is_document_being_inserted()) {
2057
+ // this document is being inserted, so should not be visible yet
2058
+ return cb(std::nullopt, std::nullopt, std::nullopt);
2059
+ }
2060
+
2061
+ return cb(std::nullopt, std::nullopt, doc);
2062
+ }
2063
+
2064
+ core::document_id doc_atr_id{ doc->links().atr_bucket_name().value(),
2065
+ doc->links().atr_scope_name().value(),
2066
+ doc->links().atr_collection_name().value(),
2067
+ doc->links().atr_id().value() };
2068
+ active_transaction_record::get_atr(
2069
+ cluster_ref(),
2070
+ doc_atr_id,
2071
+ [this, id, doc, cb = std::move(cb)](std::error_code ec2, std::optional<active_transaction_record> atr) mutable {
2072
+ if (!ec2 && atr) {
2073
+ active_transaction_record& atr_doc = atr.value();
2074
+ std::optional<atr_entry> entry;
2075
+ for (const auto& e : atr_doc.entries()) {
2076
+ if (doc->links().staged_attempt_id().value() == e.attempt_id()) {
2077
+ entry.emplace(e);
2078
+ break;
2079
+ }
2080
+ }
2081
+ bool ignore_doc = false;
2082
+ auto content = doc->content();
2083
+ if (entry) {
2084
+ if (doc->links().staged_attempt_id() && entry->attempt_id() == this->id()) {
2085
+ // Attempt is reading its own writes
2086
+ // This is here as backup, it should be returned from the in-memory cache instead
2087
+ content = doc->links().staged_content();
2088
+ } else {
2089
+ auto err = forward_compat::check(forward_compat_stage::GETS_READING_ATR, entry->forward_compat());
2090
+ if (err) {
2091
+ return cb(FAIL_OTHER, err->what(), std::nullopt);
2092
+ }
2093
+ switch (entry->state()) {
2094
+ case attempt_state::COMPLETED:
2095
+ case attempt_state::COMMITTED:
2096
+ if (doc->links().is_document_being_removed()) {
2097
+ ignore_doc = true;
2098
+ } else {
2099
+ content = doc->links().staged_content();
2100
+ }
2101
+ break;
2102
+ default:
2103
+ if (doc->links().is_document_being_inserted()) {
2104
+ // This document is being inserted, so should not be visible yet
2105
+ ignore_doc = true;
2106
+ }
2107
+ break;
2108
+ }
2109
+ }
2110
+ } else {
2111
+ // failed to get the ATR entry
2112
+ CB_ATTEMPT_CTX_LOG_DEBUG(this,
2113
+ "could not get ATR entry, checking again with {}",
2114
+ doc->links().staged_attempt_id().value_or("-"));
2115
+ return do_get(id, doc->links().staged_attempt_id(), cb);
2116
+ }
2117
+ if (ignore_doc) {
2118
+ return cb(std::nullopt, std::nullopt, std::nullopt);
2119
+ }
2120
+ return cb(std::nullopt, std::nullopt, transaction_get_result::create_from(*doc, content));
2121
+
2122
+ } else {
2123
+ // failed to get the ATR
2124
+ CB_ATTEMPT_CTX_LOG_DEBUG(
2125
+ this, "could not get ATR, checking again with {}", doc->links().staged_attempt_id().value_or("-"));
2126
+ return do_get(id, doc->links().staged_attempt_id(), cb);
2127
+ }
2128
+ });
2129
+ } else {
2130
+ if (doc->links().is_deleted()) {
2131
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "doc not in txn, and is_deleted, so not returning it.");
2132
+ // doc has been deleted, not in txn, so don't return it
2133
+ return cb(std::nullopt, std::nullopt, std::nullopt);
2134
+ }
2135
+ return cb(std::nullopt, std::nullopt, doc);
2136
+ }
2137
+ } else {
2138
+ return cb(ec, err_message, std::nullopt);
2139
+ }
2140
+ });
2141
+
2142
+ } catch (const transaction_operation_failed&) {
2143
+ throw;
2144
+ } catch (const std::exception& ex) {
2145
+ std::ostringstream stream;
2146
+ stream << "got error while getting doc " << id.key() << ": " << ex.what();
2147
+ throw transaction_operation_failed(FAIL_OTHER, ex.what());
2148
+ }
2149
+ }
2150
+
2151
+ void
2152
+ attempt_context_impl::get_doc(
2153
+ const core::document_id& id,
2154
+ std::function<void(std::optional<error_class>, std::optional<std::string>, std::optional<transaction_get_result>)>&& cb)
2155
+ {
2156
+ core::operations::lookup_in_request req{ id };
2157
+ req.specs =
2158
+ lookup_in_specs{
2159
+ lookup_in_specs::get(ATR_ID).xattr(),
2160
+ lookup_in_specs::get(TRANSACTION_ID).xattr(),
2161
+ lookup_in_specs::get(ATTEMPT_ID).xattr(),
2162
+ lookup_in_specs::get(OPERATION_ID).xattr(),
2163
+ lookup_in_specs::get(STAGED_DATA).xattr(),
2164
+ lookup_in_specs::get(ATR_BUCKET_NAME).xattr(),
2165
+ lookup_in_specs::get(ATR_SCOPE_NAME).xattr(),
2166
+ lookup_in_specs::get(ATR_COLL_NAME).xattr(),
2167
+ lookup_in_specs::get(TRANSACTION_RESTORE_PREFIX_ONLY).xattr(),
2168
+ lookup_in_specs::get(TYPE).xattr(),
2169
+ lookup_in_specs::get(subdoc::lookup_in_macro::document).xattr(),
2170
+ lookup_in_specs::get(CRC32_OF_STAGING).xattr(),
2171
+ lookup_in_specs::get(FORWARD_COMPAT).xattr(),
2172
+ lookup_in_specs::get(""),
2173
+ }
2174
+ .specs();
2175
+ req.access_deleted = true;
2176
+ wrap_request(req, overall_.config());
2177
+ try {
2178
+ overall_.cluster_ref()->execute(req, [this, id, cb = std::move(cb)](core::operations::lookup_in_response resp) {
2179
+ auto ec = error_class_from_response(resp);
2180
+ if (ec) {
2181
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "get_doc got error {} : {}", resp.ctx.ec().message(), *ec);
2182
+ switch (*ec) {
2183
+ case FAIL_PATH_NOT_FOUND:
2184
+ return cb(*ec, resp.ctx.ec().message(), transaction_get_result::create_from(resp));
2185
+ default:
2186
+ return cb(*ec, resp.ctx.ec().message(), std::nullopt);
2187
+ }
2188
+ } else {
2189
+ return cb({}, {}, transaction_get_result::create_from(resp));
2190
+ }
2191
+ });
2192
+ } catch (const std::exception& e) {
2193
+ return cb(FAIL_OTHER, e.what(), std::nullopt);
2194
+ }
2195
+ }
2196
+
2197
+ template<typename Handler, typename Delay>
2198
+ void
2199
+ attempt_context_impl::create_staged_insert_error_handler(const core::document_id& id,
2200
+ const std::vector<std::byte>& content,
2201
+ uint64_t cas,
2202
+ Delay&& delay,
2203
+ const std::string& op_id,
2204
+ Handler&& cb,
2205
+ error_class ec,
2206
+ const std::string& message)
2207
+ {
2208
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "create_staged_insert got error class {}: {}", ec, message);
2209
+ if (expiry_overtime_mode_.load()) {
2210
+ return op_completed_with_error(std::forward<Handler>(cb), transaction_operation_failed(FAIL_EXPIRY, "attempt timed out").expired());
2211
+ }
2212
+ switch (ec) {
2213
+ case FAIL_EXPIRY:
2214
+ expiry_overtime_mode_ = true;
2215
+ return op_completed_with_error(std::forward<Handler>(cb), transaction_operation_failed(ec, "attempt timed-out").expired());
2216
+ case FAIL_TRANSIENT:
2217
+ return op_completed_with_error(std::forward<Handler>(cb),
2218
+ transaction_operation_failed(ec, "transient error in insert").retry());
2219
+ case FAIL_AMBIGUOUS:
2220
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "FAIL_AMBIGUOUS in create_staged_insert, retrying");
2221
+ delay();
2222
+ return create_staged_insert(id, content, cas, delay, op_id, std::forward<Handler>(cb));
2223
+ case FAIL_OTHER:
2224
+ return op_completed_with_error(std::forward<Handler>(cb), transaction_operation_failed(ec, "error in create_staged_insert"));
2225
+ case FAIL_HARD:
2226
+ return op_completed_with_error(std::forward<Handler>(cb),
2227
+ transaction_operation_failed(ec, "error in create_staged_insert").no_rollback());
2228
+ case FAIL_DOC_ALREADY_EXISTS:
2229
+ case FAIL_CAS_MISMATCH: {
2230
+ // special handling for doc already existing
2231
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "found existing doc {}, may still be able to insert", id);
2232
+ auto error_handler = [this, id, op_id, content](error_class ec2, const std::string& err_message, Handler&& cb) mutable {
2233
+ CB_ATTEMPT_CTX_LOG_TRACE(
2234
+ this, "after a CAS_MISMATCH or DOC_ALREADY_EXISTS, then got error {} in create_staged_insert", ec2);
2235
+ if (expiry_overtime_mode_.load()) {
2236
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(FAIL_EXPIRY, "attempt timed out").expired());
2237
+ }
2238
+ switch (ec2) {
2239
+ case FAIL_DOC_NOT_FOUND:
2240
+ case FAIL_TRANSIENT:
2241
+ return op_completed_with_error(
2242
+ std::move(cb),
2243
+ transaction_operation_failed(ec2, fmt::format("error {} while handling existing doc in insert", err_message))
2244
+ .retry());
2245
+ default:
2246
+ return op_completed_with_error(
2247
+ std::move(cb),
2248
+ transaction_operation_failed(ec2,
2249
+ fmt::format("failed getting doc in create_staged_insert with {}", err_message)));
2250
+ }
2251
+ };
2252
+ if (auto err = hooks_.before_get_doc_in_exists_during_staged_insert(this, id.key()); err) {
2253
+ return error_handler(
2254
+ *err, fmt::format("before_get_doc_in_exists_during_staged_insert hook raised {}", *err), std::forward<Handler>(cb));
2255
+ }
2256
+ return get_doc(
2257
+ id,
2258
+ [this, id, content, op_id, cb = std::forward<Handler>(cb), error_handler, delay](
2259
+ std::optional<error_class> ec3, std::optional<std::string> err_message, std::optional<transaction_get_result> doc) mutable {
2260
+ if (!ec3) {
2261
+ if (doc) {
2262
+ CB_ATTEMPT_CTX_LOG_DEBUG(this,
2263
+ "document {} exists, is_in_transaction {}, is_deleted {} ",
2264
+ doc->id(),
2265
+ doc->links().is_document_in_transaction(),
2266
+ doc->links().is_deleted());
2267
+
2268
+ if (auto err = forward_compat::check(forward_compat_stage::WWC_INSERTING_GET, doc->links().forward_compat());
2269
+ err) {
2270
+ return op_completed_with_error(std::forward<Handler>(cb), *err);
2271
+ }
2272
+ if (!doc->links().is_document_in_transaction() && doc->links().is_deleted()) {
2273
+ // it is just a deleted doc, so we are ok. Let's try again, but with the cas
2274
+ CB_ATTEMPT_CTX_LOG_DEBUG(
2275
+ this, "create staged insert found existing deleted doc, retrying with cas {}", doc->cas().value());
2276
+ delay();
2277
+ return create_staged_insert(id, content, doc->cas().value(), delay, op_id, std::forward<Handler>(cb));
2278
+ }
2279
+ if (!doc->links().is_document_in_transaction()) {
2280
+ // doc was inserted outside txn elsewhere
2281
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "doc {} not in txn - was inserted outside txn", id);
2282
+ return op_completed_with_error(
2283
+ std::forward<Handler>(cb),
2284
+ document_exists({ couchbase::errc::transaction_op::document_exists_exception, key_value_error_context() }));
2285
+ }
2286
+ if (doc->links().staged_attempt_id() == this->id()) {
2287
+ if (doc->links().staged_operation_id() == op_id) {
2288
+ // this is us dealing with resolving an ambiguity. So, lets just update the staged_mutation with the
2289
+ // correct cas and continue...
2290
+ staged_mutations_->add(staged_mutation(*doc, content, staged_mutation_type::INSERT));
2291
+ return op_completed_with_callback(std::forward<Handler>(cb), doc);
2292
+ }
2293
+ return op_completed_with_error(
2294
+ std::forward<Handler>(cb),
2295
+ transaction_operation_failed(FAIL_OTHER, "concurrent operations on a document are not allowed")
2296
+ .cause(CONCURRENT_OPERATIONS_DETECTED_ON_SAME_DOCUMENT));
2297
+ }
2298
+ // CBD-3787 - Only a staged insert is ok to overwrite
2299
+ if (doc->links().op() && *doc->links().op() != "insert") {
2300
+ return op_completed_with_error(
2301
+ std::forward<Handler>(cb),
2302
+ transaction_operation_failed(FAIL_DOC_ALREADY_EXISTS, "doc exists, not a staged insert")
2303
+ .cause(DOCUMENT_EXISTS_EXCEPTION));
2304
+ }
2305
+ check_and_handle_blocking_transactions(
2306
+ *doc,
2307
+ forward_compat_stage::WWC_INSERTING,
2308
+ [this, id, op_id, content, doc, cb = std::forward<Handler>(cb), delay](
2309
+ std::optional<transaction_operation_failed> err) mutable {
2310
+ if (err) {
2311
+ return op_completed_with_error(std::move(cb), *err);
2312
+ }
2313
+ CB_ATTEMPT_CTX_LOG_DEBUG(
2314
+ this, "doc ok to overwrite, retrying create_staged_insert with cas {}", doc->cas().value());
2315
+ delay();
2316
+ return create_staged_insert(id, content, doc->cas().value(), delay, op_id, std::forward<Handler>(cb));
2317
+ });
2318
+ } else {
2319
+ // no doc now, just retry entire txn
2320
+ CB_ATTEMPT_CTX_LOG_TRACE(this, "got {} from get_doc in exists during staged insert", *ec3);
2321
+ return op_completed_with_error(
2322
+ std::move(cb),
2323
+ transaction_operation_failed(FAIL_DOC_NOT_FOUND, "insert failed as the doc existed, but now seems to not exist")
2324
+ .retry());
2325
+ }
2326
+ } else {
2327
+ return error_handler(*ec3, *err_message, std::forward<Handler>(cb));
2328
+ }
2329
+ });
2330
+ break;
2331
+ }
2332
+ default:
2333
+ return op_completed_with_error(std::move(cb), transaction_operation_failed(ec, "failed in create_staged_insert").retry());
2334
+ }
2335
+ }
2336
+
2337
+ template<typename Handler, typename Delay>
2338
+ void
2339
+ attempt_context_impl::create_staged_insert(const core::document_id& id,
2340
+ const std::vector<std::byte>& content,
2341
+ uint64_t cas,
2342
+ Delay&& delay,
2343
+ const std::string& op_id,
2344
+ Handler&& cb)
2345
+ {
2346
+
2347
+ if (auto ec = error_if_expired_and_not_in_overtime(STAGE_CREATE_STAGED_INSERT, id.key()); ec) {
2348
+ return create_staged_insert_error_handler(id,
2349
+ content,
2350
+ cas,
2351
+ std::forward<Delay>(delay),
2352
+ op_id,
2353
+ std::forward<Handler>(cb),
2354
+ *ec,
2355
+ "create_staged_insert expired and not in overtime");
2356
+ }
2357
+
2358
+ if (auto ec = hooks_.before_staged_insert(this, id.key()); ec) {
2359
+ return create_staged_insert_error_handler(
2360
+ id, content, cas, std::forward<Delay>(delay), op_id, std::forward<Handler>(cb), *ec, "before_staged_insert hook threw error");
2361
+ }
2362
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "about to insert staged doc {} with cas {}", id, cas);
2363
+ auto req = create_staging_request(id, nullptr, "insert", op_id, content);
2364
+ req.access_deleted = true;
2365
+ req.create_as_deleted = true;
2366
+ req.cas = couchbase::cas(cas);
2367
+ req.store_semantics = cas == 0 ? couchbase::store_semantics::insert : couchbase::store_semantics::replace;
2368
+ wrap_durable_request(req, overall_.config());
2369
+ overall_.cluster_ref()->execute(
2370
+ req,
2371
+ [this, id, content, cas, op_id, cb = std::forward<Handler>(cb), delay = std::forward<Delay>(delay)](
2372
+ core::operations::mutate_in_response resp) mutable {
2373
+ auto ec = resp.ctx.ec() ? error_class_from_response(resp) : hooks_.after_staged_insert_complete(this, id.key());
2374
+ if (ec) {
2375
+ auto msg = (resp.ctx.ec() ? resp.ctx.ec().message() : "after_staged_insert hook threw error");
2376
+ return create_staged_insert_error_handler(
2377
+ id, content, cas, std::forward<Delay>(delay), op_id, std::forward<Handler>(cb), *ec, msg);
2378
+ }
2379
+ if (!resp.ctx.ec()) {
2380
+ CB_ATTEMPT_CTX_LOG_DEBUG(this, "inserted doc {} CAS={}, {}", id, resp.cas.value(), resp.ctx.ec().message());
2381
+
2382
+ // TODO: clean this up (do most of this in transactions_document(...))
2383
+ transaction_links links(atr_id_->key(),
2384
+ id.bucket(),
2385
+ id.scope(),
2386
+ id.collection(),
2387
+ overall_.transaction_id(),
2388
+ this->id(),
2389
+ op_id,
2390
+ content,
2391
+ std::nullopt,
2392
+ std::nullopt,
2393
+ std::nullopt,
2394
+ std::nullopt,
2395
+ std::string("insert"),
2396
+ std::nullopt,
2397
+ true);
2398
+ transaction_get_result out(id, content, resp.cas.value(), links, std::nullopt);
2399
+ staged_mutations_->add(staged_mutation(out, content, staged_mutation_type::INSERT));
2400
+ return op_completed_with_callback(cb, std::optional<transaction_get_result>(out));
2401
+ }
2402
+ return create_staged_insert_error_handler(id,
2403
+ content,
2404
+ cas,
2405
+ std::forward<Delay>(delay),
2406
+ op_id,
2407
+ std::forward<Handler>(cb),
2408
+ error_class_from_response(resp).value(),
2409
+ resp.ctx.ec().message());
2410
+ });
2411
+ }
2412
+
2413
+ } // namespace couchbase::core::transactions