couchbase 4.2.8 → 4.2.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CMakeLists.txt +1 -1
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +139 -56
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
- package/deps/couchbase-cxx-client/CMakeLists.txt +401 -424
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +7 -3
- package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +1 -0
- package/deps/couchbase-cxx-client/core/agent_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/agent_group.cxx +0 -1
- package/deps/couchbase-cxx-client/core/agent_group.hxx +9 -0
- package/deps/couchbase-cxx-client/core/agent_group_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/bucket.cxx +74 -10
- package/deps/couchbase-cxx-client/core/bucket.hxx +4 -2
- package/deps/couchbase-cxx-client/core/cluster.cxx +1491 -108
- package/deps/couchbase-cxx-client/core/cluster.hxx +183 -473
- package/deps/couchbase-cxx-client/core/cluster_agent_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/cluster_options.cxx +12 -2
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +9 -8
- package/deps/couchbase-cxx-client/core/config_profiles.cxx +2 -2
- package/deps/couchbase-cxx-client/core/config_profiles.hxx +1 -1
- package/deps/couchbase-cxx-client/core/core_sdk_shim.cxx +1 -2
- package/deps/couchbase-cxx-client/core/core_sdk_shim.hxx +3 -2
- package/deps/couchbase-cxx-client/core/diagnostics.hxx +0 -1
- package/deps/couchbase-cxx-client/core/dispatcher.cxx +2 -2
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +38 -76
- package/deps/couchbase-cxx-client/core/impl/analytics.hxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/analytics_index_manager.cxx +820 -0
- package/deps/couchbase-cxx-client/core/impl/binary_collection.cxx +403 -0
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +102 -0
- package/deps/couchbase-cxx-client/core/impl/bucket_manager.cxx +433 -0
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +299 -44
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +1384 -0
- package/deps/couchbase-cxx-client/core/impl/collection_manager.cxx +306 -0
- package/deps/couchbase-cxx-client/core/impl/configuration_profiles_registry.cxx +3 -1
- package/deps/couchbase-cxx-client/core/impl/diagnostics.cxx +294 -0
- package/deps/couchbase-cxx-client/core/impl/diagnostics.hxx +39 -0
- package/deps/couchbase-cxx-client/core/impl/dns_srv_tracker.cxx +2 -0
- package/deps/couchbase-cxx-client/core/{operations/mcbp_noop.cxx → impl/doc_id_query.cxx} +19 -15
- package/deps/couchbase-cxx-client/core/impl/key_value_error_category.cxx +4 -2
- package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.hxx +0 -10
- package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.hxx +0 -10
- package/deps/couchbase-cxx-client/core/impl/observe_poll.cxx +24 -17
- package/deps/couchbase-cxx-client/core/impl/observe_poll.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/query.cxx +45 -68
- package/deps/couchbase-cxx-client/core/impl/query.hxx +34 -0
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +628 -0
- package/deps/couchbase-cxx-client/core/impl/scope.cxx +187 -0
- package/deps/couchbase-cxx-client/core/impl/search.cxx +81 -57
- package/deps/couchbase-cxx-client/core/impl/search.hxx +45 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +712 -0
- package/deps/couchbase-cxx-client/core/impl/search_request.cxx +139 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +12 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_geo_distance.cxx +87 -0
- package/deps/couchbase-cxx-client/core/impl/vector_query.cxx +42 -0
- package/deps/couchbase-cxx-client/core/impl/vector_search.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/with_legacy_durability.hxx +23 -25
- package/deps/couchbase-cxx-client/core/io/dns_config.cxx +28 -0
- package/deps/couchbase-cxx-client/core/io/dns_config.hxx +6 -25
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +6 -3
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +9 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +1 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_message.hxx +3 -2
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +75 -53
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +3 -1
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +1 -1
- package/deps/couchbase-cxx-client/core/logger/logger.hxx +4 -4
- package/deps/couchbase-cxx-client/core/management/bucket_settings.hxx +1 -1
- package/deps/couchbase-cxx-client/core/mcbp/packet.cxx +1 -1
- package/deps/couchbase-cxx-client/core/mcbp/queue_callback.hxx +1 -1
- package/deps/couchbase-cxx-client/core/meta/features.hxx +38 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +23 -2
- package/deps/couchbase-cxx-client/core/operations/document_query.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/document_search.cxx +37 -1
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +11 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataset_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_dataverse_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_get_pending_mutations.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_index_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_connect.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_disconnect.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/analytics_link_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_create.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/bucket_describe.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_flush.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/bucket_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/change_password.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +9 -6
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/collection_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +9 -8
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +9 -5
- package/deps/couchbase-cxx-client/core/operations/management/eventing_deploy_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_drop_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_get_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_pause_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_resume_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_undeploy_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/eventing_upsert_function.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/group_get_all.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_build_deferred.hxx +2 -2
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_drop.cxx +4 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.cxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/query_index_get_all.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/scope_create.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/scope_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.cxx +4 -4
- package/deps/couchbase-cxx-client/core/operations/management/search_get_stats.hxx +4 -4
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +19 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +23 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +23 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +23 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +19 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +19 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +39 -22
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +20 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_stats.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +19 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_drop.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_get_all.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/view_index_upsert.cxx +2 -0
- package/deps/couchbase-cxx-client/core/operations.hxx +0 -1
- package/deps/couchbase-cxx-client/core/operations_fwd.hxx +260 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +146 -5
- package/deps/couchbase-cxx-client/core/origin.hxx +30 -140
- package/deps/couchbase-cxx-client/core/protocol/cmd_cluster_map_change_notification.hxx +3 -3
- package/deps/couchbase-cxx-client/core/protocol/cmd_hello.hxx +5 -0
- package/deps/couchbase-cxx-client/core/protocol/cmd_observe_seqno.hxx +4 -4
- package/deps/couchbase-cxx-client/core/protocol/hello_feature.hxx +6 -0
- package/deps/couchbase-cxx-client/core/protocol/hello_feature_fmt.hxx +3 -0
- package/deps/couchbase-cxx-client/core/protocol/status.cxx +6 -0
- package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
- package/deps/couchbase-cxx-client/core/query_context.hxx +11 -7
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator.cxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/collections_manifest.hxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/collections_manifest_json.hxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/configuration.cxx +23 -0
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +8 -12
- package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +3 -3
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +2 -0
- package/deps/couchbase-cxx-client/core/topology/error_map.hxx +2 -2
- package/deps/couchbase-cxx-client/core/topology/error_map_json.hxx +4 -0
- package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.cxx +58 -0
- package/deps/couchbase-cxx-client/core/transactions/active_transaction_record.hxx +5 -40
- package/deps/couchbase-cxx-client/core/transactions/async_attempt_context.cxx +30 -0
- package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +18 -18
- package/deps/couchbase-cxx-client/core/transactions/attempt_context.cxx +36 -0
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +39 -41
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.hxx +2 -2
- package/deps/couchbase-cxx-client/core/transactions/internal/atr_cleanup_entry.hxx +3 -1
- package/deps/couchbase-cxx-client/core/transactions/internal/atr_entry.hxx +2 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.cxx +32 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record.hxx +4 -30
- package/deps/couchbase-cxx-client/core/transactions/internal/doc_record_fmt.hxx +41 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/logging.hxx +17 -15
- package/deps/couchbase-cxx-client/core/transactions/internal/transaction_context.hxx +1 -1
- package/deps/couchbase-cxx-client/core/transactions/internal/transactions_cleanup.hxx +4 -4
- package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +5 -13
- package/deps/couchbase-cxx-client/core/transactions/result.hxx +0 -26
- package/deps/couchbase-cxx-client/core/transactions/result_fmt.hxx +46 -0
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +16 -14
- package/deps/couchbase-cxx-client/core/transactions/transaction_context.cxx +6 -6
- package/deps/couchbase-cxx-client/core/transactions/transaction_keyspace.cxx +48 -0
- package/deps/couchbase-cxx-client/core/transactions/transaction_links.hxx +1 -0
- package/deps/couchbase-cxx-client/core/transactions/transaction_options.cxx +61 -4
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +9 -8
- package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +9 -16
- package/deps/couchbase-cxx-client/core/transactions/transactions_config.cxx +7 -6
- package/deps/couchbase-cxx-client/core/transactions.hxx +6 -5
- package/deps/couchbase-cxx-client/core/utils/join_strings.hxx +4 -3
- package/deps/couchbase-cxx-client/core/utils/keyspace.hxx +4 -4
- package/deps/couchbase-cxx-client/core/vector_query_combination.hxx +23 -0
- package/deps/couchbase-cxx-client/couchbase/allow_querying_search_index_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/analytics_index_manager.hxx +463 -0
- package/deps/couchbase-cxx-client/couchbase/analyze_document_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/append_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/behavior_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/binary_collection.hxx +19 -115
- package/deps/couchbase-cxx-client/couchbase/bucket.hxx +42 -30
- package/deps/couchbase-cxx-client/couchbase/bucket_manager.hxx +8 -7
- package/deps/couchbase-cxx-client/couchbase/build_query_index_options.hxx +0 -1
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +151 -73
- package/deps/couchbase-cxx-client/couchbase/cluster_options.hxx +1 -27
- package/deps/couchbase-cxx-client/couchbase/codec/json_transcoder.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/codec/raw_binary_transcoder.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/codec/raw_json_transcoder.hxx +78 -0
- package/deps/couchbase-cxx-client/couchbase/codec/raw_string_transcoder.hxx +72 -0
- package/deps/couchbase-cxx-client/couchbase/collection.hxx +176 -386
- package/deps/couchbase-cxx-client/couchbase/collection_manager.hxx +8 -9
- package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +21 -24
- package/deps/couchbase-cxx-client/couchbase/connect_link_analytics_options.hxx +116 -0
- package/deps/couchbase-cxx-client/couchbase/create_bucket_options.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/create_collection_options.hxx +32 -3
- package/deps/couchbase-cxx-client/couchbase/create_dataset_analytics_options.hxx +120 -0
- package/deps/couchbase-cxx-client/couchbase/create_dataverse_analytics_options.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/create_index_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/create_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/decrement_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/diagnostics_options.hxx +75 -0
- package/deps/couchbase-cxx-client/couchbase/diagnostics_result.hxx +124 -0
- package/deps/couchbase-cxx-client/couchbase/disallow_querying_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/disconnect_link_analytics_options.hxx +105 -0
- package/deps/couchbase-cxx-client/couchbase/drop_dataset_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/drop_dataverse_analytics_options.hxx +84 -0
- package/deps/couchbase-cxx-client/couchbase/drop_index_analytics_options.hxx +103 -0
- package/deps/couchbase-cxx-client/couchbase/drop_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/drop_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/endpoint_diagnostics.hxx +206 -0
- package/deps/couchbase-cxx-client/couchbase/endpoint_ping_report.hxx +205 -0
- package/deps/couchbase-cxx-client/couchbase/error_codes.hxx +22 -1
- package/deps/couchbase-cxx-client/couchbase/exists_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/fmt/key_value_error_map_attribute.hxx +6 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/transaction_keyspace.hxx +37 -0
- package/deps/couchbase-cxx-client/couchbase/freeze_plan_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_datasets_analytics_options.hxx +66 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_indexes_analytics_options.hxx +65 -0
- package/deps/couchbase-cxx-client/couchbase/get_all_query_indexes_options.hxx +1 -4
- package/deps/couchbase-cxx-client/couchbase/get_all_replicas_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/get_all_search_indexes_options.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/get_and_lock_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/get_and_touch_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/get_any_replica_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/get_indexed_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/get_links_analytics_options.hxx +121 -0
- package/deps/couchbase-cxx-client/couchbase/get_options.hxx +1 -29
- package/deps/couchbase-cxx-client/couchbase/get_pending_mutations_analytics_options.hxx +67 -0
- package/deps/couchbase-cxx-client/couchbase/get_search_index_options.hxx +44 -0
- package/deps/couchbase-cxx-client/couchbase/increment_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/insert_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/key_value_error_map_attribute.hxx +12 -0
- package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/lookup_in_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/management/analytics_dataset.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/management/analytics_index.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/management/analytics_link.hxx +239 -0
- package/deps/couchbase-cxx-client/couchbase/management/collection_spec.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/management/query_index.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/management/search_index.hxx +40 -0
- package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +0 -1
- package/deps/couchbase-cxx-client/couchbase/mutate_in_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/network_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/pause_ingest_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +19 -0
- package/deps/couchbase-cxx-client/couchbase/ping_options.hxx +93 -0
- package/deps/couchbase-cxx-client/couchbase/ping_result.hxx +118 -0
- package/deps/couchbase-cxx-client/couchbase/prepend_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +99 -20
- package/deps/couchbase-cxx-client/couchbase/query_options.hxx +0 -21
- package/deps/couchbase-cxx-client/couchbase/remove_options.hxx +0 -23
- package/deps/couchbase-cxx-client/couchbase/replace_link_analytics_options.hxx +63 -0
- package/deps/couchbase-cxx-client/couchbase/replace_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/resume_ingest_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +37 -53
- package/deps/couchbase-cxx-client/couchbase/scope_search_index_manager.hxx +291 -0
- package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +1 -7
- package/deps/couchbase-cxx-client/couchbase/search_geo_distance_units.hxx +26 -0
- package/deps/couchbase-cxx-client/couchbase/search_index_manager.hxx +292 -0
- package/deps/couchbase-cxx-client/couchbase/search_request.hxx +120 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +10 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_geo_distance.hxx +84 -0
- package/deps/couchbase-cxx-client/couchbase/security_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/service_type.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/touch_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/tracing/request_tracer.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/async_attempt_context.hxx +10 -7
- package/deps/couchbase-cxx-client/couchbase/transactions/attempt_context.hxx +10 -10
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_keyspace.hxx +8 -58
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +28 -70
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +7 -2
- package/deps/couchbase-cxx-client/couchbase/transactions/transactions_cleanup_config.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transactions_config.hxx +11 -38
- package/deps/couchbase-cxx-client/couchbase/unfreeze_plan_search_index_options.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/unlock_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/update_collection_options.hxx +32 -3
- package/deps/couchbase-cxx-client/couchbase/upsert_options.hxx +0 -24
- package/deps/couchbase-cxx-client/couchbase/upsert_search_index_options.hxx +41 -0
- package/deps/couchbase-cxx-client/couchbase/vector_query.hxx +99 -0
- package/deps/couchbase-cxx-client/couchbase/vector_search.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/vector_search_options.hxx +76 -0
- package/dist/binding.d.ts +16 -9
- package/dist/binding.js +4 -1
- package/dist/bindingutilities.d.ts +6 -1
- package/dist/bindingutilities.js +17 -1
- package/dist/cluster.d.ts +12 -1
- package/dist/cluster.js +22 -0
- package/dist/collection.js +3 -3
- package/dist/couchbase.d.ts +1 -0
- package/dist/couchbase.js +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +14 -2
- package/dist/searchexecutor.d.ts +2 -2
- package/dist/searchexecutor.js +19 -3
- package/dist/searchtypes.d.ts +46 -0
- package/dist/searchtypes.js +81 -1
- package/dist/transactions.d.ts +2 -0
- package/dist/transactions.js +2 -3
- package/dist/usermanager.js +1 -1
- package/dist/vectorsearch.d.ts +99 -0
- package/dist/vectorsearch.js +132 -0
- package/package.json +7 -7
- package/src/binding.cpp +1 -0
- package/src/connection.cpp +12 -9
- package/src/connection.hpp +3 -3
- package/src/connection_autogen.cpp +7 -5
- package/src/constants.cpp +14 -0
- package/src/instance.cpp +2 -2
- package/src/instance.hpp +1 -1
- package/src/jstocbpp_autogen.hpp +45 -45
- package/src/jstocbpp_basic.hpp +2 -0
- package/src/jstocbpp_errors.hpp +1 -0
- package/src/jstocbpp_transactions.hpp +6 -22
- package/src/mutationtoken.hpp +1 -0
- package/tools/gen-bindings-json.py +41 -16
- package/deps/couchbase-cxx-client/core/impl/append.cxx +0 -87
- package/deps/couchbase-cxx-client/core/impl/build_deferred_query_indexes.cxx +0 -157
- package/deps/couchbase-cxx-client/core/impl/create_bucket.cxx +0 -158
- package/deps/couchbase-cxx-client/core/impl/create_collection.cxx +0 -83
- package/deps/couchbase-cxx-client/core/impl/create_query_index.cxx +0 -232
- package/deps/couchbase-cxx-client/core/impl/create_scope.cxx +0 -69
- package/deps/couchbase-cxx-client/core/impl/decrement.cxx +0 -96
- package/deps/couchbase-cxx-client/core/impl/drop_bucket.cxx +0 -66
- package/deps/couchbase-cxx-client/core/impl/drop_collection.cxx +0 -76
- package/deps/couchbase-cxx-client/core/impl/drop_query_index.cxx +0 -187
- package/deps/couchbase-cxx-client/core/impl/drop_scope.cxx +0 -68
- package/deps/couchbase-cxx-client/core/impl/exists.cxx +0 -47
- package/deps/couchbase-cxx-client/core/impl/flush_bucket.cxx +0 -66
- package/deps/couchbase-cxx-client/core/impl/get.cxx +0 -68
- package/deps/couchbase-cxx-client/core/impl/get_all_buckets.cxx +0 -178
- package/deps/couchbase-cxx-client/core/impl/get_all_query_indexes.cxx +0 -106
- package/deps/couchbase-cxx-client/core/impl/get_all_replicas.cxx +0 -145
- package/deps/couchbase-cxx-client/core/impl/get_all_scopes.cxx +0 -94
- package/deps/couchbase-cxx-client/core/impl/get_and_lock.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/get_and_touch.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/get_any_replica.cxx +0 -134
- package/deps/couchbase-cxx-client/core/impl/get_bucket.cxx +0 -168
- package/deps/couchbase-cxx-client/core/impl/increment.cxx +0 -96
- package/deps/couchbase-cxx-client/core/impl/insert.cxx +0 -90
- package/deps/couchbase-cxx-client/core/impl/lookup_in.cxx +0 -69
- package/deps/couchbase-cxx-client/core/impl/lookup_in_all_replicas.cxx +0 -178
- package/deps/couchbase-cxx-client/core/impl/lookup_in_any_replica.cxx +0 -169
- package/deps/couchbase-cxx-client/core/impl/mutate_in.cxx +0 -125
- package/deps/couchbase-cxx-client/core/impl/prepend.cxx +0 -87
- package/deps/couchbase-cxx-client/core/impl/remove.cxx +0 -86
- package/deps/couchbase-cxx-client/core/impl/replace.cxx +0 -102
- package/deps/couchbase-cxx-client/core/impl/touch.cxx +0 -49
- package/deps/couchbase-cxx-client/core/impl/unlock.cxx +0 -47
- package/deps/couchbase-cxx-client/core/impl/update_bucket.cxx +0 -133
- package/deps/couchbase-cxx-client/core/impl/update_collection.cxx +0 -83
- package/deps/couchbase-cxx-client/core/impl/upsert.cxx +0 -100
- package/deps/couchbase-cxx-client/core/impl/watch_query_indexes.cxx +0 -196
- package/deps/couchbase-cxx-client/core/operations/mcbp_noop.hxx +0 -49
- /package/deps/couchbase-cxx-client/core/impl/{streaming_json_lexter_error_category.cxx → streaming_json_lexer_error_category.cxx} +0 -0
@@ -51,6 +51,7 @@
|
|
51
51
|
#include "streams.hxx"
|
52
52
|
|
53
53
|
#include <couchbase/build_config.hxx>
|
54
|
+
#include <couchbase/error_codes.hxx>
|
54
55
|
#include <couchbase/fmt/retry_reason.hxx>
|
55
56
|
|
56
57
|
#include <asio.hpp>
|
@@ -153,12 +154,12 @@ struct connection_endpoints {
|
|
153
154
|
connection_endpoints(asio::ip::tcp::endpoint remote_endpoint, asio::ip::tcp::endpoint local_endpoint)
|
154
155
|
: remote{ std::move(remote_endpoint) }
|
155
156
|
, remote_address{ remote.address().to_string() }
|
156
|
-
, remote_address_with_port{
|
157
|
-
|
158
|
-
remote.port()) }
|
157
|
+
, remote_address_with_port{ remote.protocol() == asio::ip::tcp::v6() ? fmt::format("[{}]:{}", remote_address, remote.port())
|
158
|
+
: fmt::format("{}:{}", remote_address, remote.port()) }
|
159
159
|
, local{ std::move(local_endpoint) }
|
160
160
|
, local_address{ local.address().to_string() }
|
161
|
-
, local_address_with_port{
|
161
|
+
, local_address_with_port{ local.protocol() == asio::ip::tcp::v6() ? fmt::format("[{}]:{}", local_address, local.port())
|
162
|
+
: fmt::format("{}:{}", local_address, local.port()) }
|
162
163
|
{
|
163
164
|
}
|
164
165
|
|
@@ -245,6 +246,7 @@ class mcbp_session_impl
|
|
245
246
|
}
|
246
247
|
if (session_->origin_.options().enable_clustermap_notification) {
|
247
248
|
hello_req.body().enable_clustermap_change_notification();
|
249
|
+
hello_req.body().enable_deduplicate_not_my_vbucket_clustermap();
|
248
250
|
}
|
249
251
|
if (session_->origin_.options().enable_compression) {
|
250
252
|
hello_req.body().enable_compression();
|
@@ -259,7 +261,7 @@ class mcbp_session_impl
|
|
259
261
|
CB_LOG_DEBUG("{} user_agent={}, requested_features=[{}]",
|
260
262
|
session_->log_prefix_,
|
261
263
|
user_agent,
|
262
|
-
utils::join_strings_fmt(
|
264
|
+
utils::join_strings_fmt(hello_req.body().features(), ", "));
|
263
265
|
session_->write(hello_req.data());
|
264
266
|
|
265
267
|
if (!session_->origin_.credentials().uses_certificate()) {
|
@@ -347,7 +349,7 @@ class mcbp_session_impl
|
|
347
349
|
session_->supported_features_ = resp.body().supported_features();
|
348
350
|
CB_LOG_DEBUG("{} supported_features=[{}]",
|
349
351
|
session_->log_prefix_,
|
350
|
-
utils::join_strings_fmt(
|
352
|
+
utils::join_strings_fmt(session_->supported_features_, ", "));
|
351
353
|
if (session_->origin_.credentials().uses_certificate()) {
|
352
354
|
CB_LOG_DEBUG("{} skip SASL authentication, because TLS certificate was specified",
|
353
355
|
session_->log_prefix_);
|
@@ -540,17 +542,11 @@ class mcbp_session_impl
|
|
540
542
|
{
|
541
543
|
private:
|
542
544
|
std::shared_ptr<mcbp_session_impl> session_;
|
543
|
-
asio::steady_timer heartbeat_timer_;
|
544
|
-
std::chrono::milliseconds heartbeat_interval_;
|
545
545
|
std::atomic_bool stopped_{ false };
|
546
546
|
|
547
547
|
public:
|
548
548
|
explicit message_handler(std::shared_ptr<mcbp_session_impl> session)
|
549
549
|
: session_(std::move(session))
|
550
|
-
, heartbeat_timer_(session_->ctx_)
|
551
|
-
, heartbeat_interval_{ session_->origin_.options().config_poll_floor > session_->origin_.options().config_poll_interval
|
552
|
-
? session_->origin_.options().config_poll_floor
|
553
|
-
: session_->origin_.options().config_poll_interval }
|
554
550
|
{
|
555
551
|
}
|
556
552
|
|
@@ -561,16 +557,10 @@ class mcbp_session_impl
|
|
561
557
|
|
562
558
|
void start()
|
563
559
|
{
|
564
|
-
if (session_->supports_gcccp_) {
|
565
|
-
fetch_config({});
|
566
|
-
}
|
567
560
|
}
|
568
561
|
|
569
562
|
void stop()
|
570
563
|
{
|
571
|
-
if (bool expected_state{ false }; stopped_.compare_exchange_strong(expected_state, true)) {
|
572
|
-
heartbeat_timer_.cancel();
|
573
|
-
}
|
574
564
|
}
|
575
565
|
|
576
566
|
void handle(mcbp_message&& msg)
|
@@ -664,7 +654,18 @@ class mcbp_session_impl
|
|
664
654
|
Expects(protocol::is_valid_server_request_opcode(msg.header.opcode));
|
665
655
|
switch (static_cast<protocol::server_opcode>(msg.header.opcode)) {
|
666
656
|
case protocol::server_opcode::cluster_map_change_notification: {
|
667
|
-
protocol::
|
657
|
+
protocol::cmd_info info{ session_->bootstrap_hostname_, session_->bootstrap_port_number_ };
|
658
|
+
if (session_->origin_.options().dump_configuration) {
|
659
|
+
std::string_view config_text{ reinterpret_cast<const char*>(msg.body.data()), msg.body.size() };
|
660
|
+
CB_LOG_TRACE(
|
661
|
+
"{} configuration from cluster_map_change_notification request (size={}, endpoint=\"{}:{}\"), {}",
|
662
|
+
session_->log_prefix_,
|
663
|
+
config_text.size(),
|
664
|
+
info.endpoint_address,
|
665
|
+
info.endpoint_port,
|
666
|
+
config_text);
|
667
|
+
}
|
668
|
+
protocol::server_request<protocol::cluster_map_change_notification_request_body> req(std::move(msg), info);
|
668
669
|
std::optional<topology::configuration> config = req.body().config();
|
669
670
|
if (session_ && config.has_value()) {
|
670
671
|
if ((!config->bucket.has_value() && req.body().bucket().empty()) ||
|
@@ -696,23 +697,6 @@ class mcbp_session_impl
|
|
696
697
|
break;
|
697
698
|
}
|
698
699
|
}
|
699
|
-
|
700
|
-
void fetch_config(std::error_code ec)
|
701
|
-
{
|
702
|
-
if (ec == asio::error::operation_aborted || stopped_ || !session_) {
|
703
|
-
return;
|
704
|
-
}
|
705
|
-
protocol::client_request<protocol::get_cluster_config_request_body> req;
|
706
|
-
req.opaque(session_->next_opaque());
|
707
|
-
session_->write_and_flush(req.data());
|
708
|
-
heartbeat_timer_.expires_after(heartbeat_interval_);
|
709
|
-
heartbeat_timer_.async_wait([self = shared_from_this()](std::error_code e) {
|
710
|
-
if (e == asio::error::operation_aborted) {
|
711
|
-
return;
|
712
|
-
}
|
713
|
-
self->fetch_config(e);
|
714
|
-
});
|
715
|
-
}
|
716
700
|
};
|
717
701
|
|
718
702
|
public:
|
@@ -730,6 +714,7 @@ class mcbp_session_impl
|
|
730
714
|
, bootstrap_deadline_(ctx_)
|
731
715
|
, connection_deadline_(ctx_)
|
732
716
|
, retry_backoff_(ctx_)
|
717
|
+
, ping_deadline_(ctx_)
|
733
718
|
, origin_{ std::move(origin) }
|
734
719
|
, bucket_name_{ std::move(bucket_name) }
|
735
720
|
, supported_features_{ std::move(known_features) }
|
@@ -754,6 +739,7 @@ class mcbp_session_impl
|
|
754
739
|
, bootstrap_deadline_(ctx_)
|
755
740
|
, connection_deadline_(ctx_)
|
756
741
|
, retry_backoff_(ctx_)
|
742
|
+
, ping_deadline_(ctx_)
|
757
743
|
, origin_(std::move(origin))
|
758
744
|
, bucket_name_(std::move(bucket_name))
|
759
745
|
, supported_features_(std::move(known_features))
|
@@ -798,7 +784,7 @@ class mcbp_session_impl
|
|
798
784
|
bucket_name_ };
|
799
785
|
}
|
800
786
|
|
801
|
-
void ping(std::shared_ptr<diag::ping_reporter> handler)
|
787
|
+
void ping(std::shared_ptr<diag::ping_reporter> handler, std::optional<std::chrono::milliseconds> timeout)
|
802
788
|
{
|
803
789
|
protocol::client_request<protocol::mcbp_noop_request_body> req;
|
804
790
|
req.opaque(next_opaque());
|
@@ -812,7 +798,11 @@ class mcbp_session_impl
|
|
812
798
|
diag::ping_state state = diag::ping_state::ok;
|
813
799
|
std::optional<std::string> error{};
|
814
800
|
if (ec) {
|
815
|
-
|
801
|
+
if (ec == errc::common::unambiguous_timeout || ec == errc::common::ambiguous_timeout) {
|
802
|
+
state = diag::ping_state::timeout;
|
803
|
+
} else {
|
804
|
+
state = diag::ping_state::error;
|
805
|
+
}
|
816
806
|
error.emplace(fmt::format("code={}, message={}, reason={}", ec.value(), ec.message(), reason));
|
817
807
|
}
|
818
808
|
handler->report({
|
@@ -826,6 +816,13 @@ class mcbp_session_impl
|
|
826
816
|
error,
|
827
817
|
});
|
828
818
|
});
|
819
|
+
ping_deadline_.expires_after(timeout.value_or(origin_.options().key_value_timeout));
|
820
|
+
ping_deadline_.async_wait([self = this->shared_from_this(), opaque = req.opaque()](std::error_code ec) {
|
821
|
+
if (ec == asio::error::operation_aborted) {
|
822
|
+
return;
|
823
|
+
}
|
824
|
+
static_cast<void>(self->cancel(opaque, errc::common::unambiguous_timeout, retry_reason::do_not_retry));
|
825
|
+
});
|
829
826
|
}
|
830
827
|
|
831
828
|
[[nodiscard]] mcbp_context context() const
|
@@ -850,8 +847,9 @@ class mcbp_session_impl
|
|
850
847
|
self->state_listener_->report_bootstrap_error(fmt::format("{}:{}", self->bootstrap_hostname_, self->bootstrap_port_), ec);
|
851
848
|
}
|
852
849
|
CB_LOG_WARNING("{} unable to bootstrap in time", self->log_prefix_);
|
853
|
-
auto h = std::move(self->bootstrap_callback_);
|
854
|
-
|
850
|
+
if (auto h = std::move(self->bootstrap_callback_); h) {
|
851
|
+
h(ec, {});
|
852
|
+
}
|
855
853
|
self->stop(retry_reason::do_not_retry);
|
856
854
|
});
|
857
855
|
initiate_bootstrap();
|
@@ -926,6 +924,7 @@ class mcbp_session_impl
|
|
926
924
|
bootstrap_deadline_.cancel();
|
927
925
|
connection_deadline_.cancel();
|
928
926
|
retry_backoff_.cancel();
|
927
|
+
ping_deadline_.cancel();
|
929
928
|
resolver_.cancel();
|
930
929
|
stream_->close([](std::error_code) {});
|
931
930
|
if (auto h = std::move(bootstrap_handler_); h) {
|
@@ -1024,8 +1023,10 @@ class mcbp_session_impl
|
|
1024
1023
|
}
|
1025
1024
|
}
|
1026
1025
|
|
1026
|
+
auto reason = status == static_cast<std::uint16_t>(key_value_status_code::not_my_vbucket) ? retry_reason::key_value_not_my_vbucket
|
1027
|
+
: retry_reason::do_not_retry;
|
1027
1028
|
if (fun) {
|
1028
|
-
fun(protocol::map_status_code(opcode, status),
|
1029
|
+
fun(protocol::map_status_code(opcode, status), reason, std::move(msg), decode_error_code(status));
|
1029
1030
|
return true;
|
1030
1031
|
}
|
1031
1032
|
|
@@ -1043,11 +1044,8 @@ class mcbp_session_impl
|
|
1043
1044
|
}
|
1044
1045
|
}
|
1045
1046
|
if (request) {
|
1046
|
-
handler->handle_response(
|
1047
|
-
|
1048
|
-
retry_reason::do_not_retry,
|
1049
|
-
std::move(msg),
|
1050
|
-
decode_error_code(status));
|
1047
|
+
handler->handle_response(
|
1048
|
+
std::move(request), protocol::map_status_code(opcode, status), reason, std::move(msg), decode_error_code(status));
|
1051
1049
|
return true;
|
1052
1050
|
}
|
1053
1051
|
return false;
|
@@ -1245,11 +1243,12 @@ class mcbp_session_impl
|
|
1245
1243
|
}
|
1246
1244
|
}
|
1247
1245
|
}
|
1246
|
+
config_.reset();
|
1248
1247
|
config_.emplace(std::move(config));
|
1249
1248
|
configured_ = true;
|
1250
1249
|
for (const auto& listener : config_listeners_) {
|
1251
|
-
asio::post(
|
1252
|
-
ctx_, [listener,
|
1250
|
+
asio::post(
|
1251
|
+
asio::bind_executor(ctx_, [listener, c = config_.value()]() mutable { return listener->update_config(std::move(c)); }));
|
1253
1252
|
}
|
1254
1253
|
}
|
1255
1254
|
|
@@ -1372,6 +1371,7 @@ class mcbp_session_impl
|
|
1372
1371
|
return initiate_bootstrap();
|
1373
1372
|
}
|
1374
1373
|
endpoints_ = endpoints;
|
1374
|
+
CB_LOG_TRACE("{} resolved \"{}:{}\" to {} endpoint(s)", log_prefix_, bootstrap_hostname_, bootstrap_port_, endpoints_.size());
|
1375
1375
|
do_connect(endpoints_.begin());
|
1376
1376
|
connection_deadline_.expires_after(origin_.options().resolve_timeout);
|
1377
1377
|
connection_deadline_.async_wait([self = shared_from_this()](const auto timer_ec) {
|
@@ -1391,19 +1391,33 @@ class mcbp_session_impl
|
|
1391
1391
|
if (it != endpoints_.end()) {
|
1392
1392
|
auto hostname = it->endpoint().address().to_string();
|
1393
1393
|
auto port = it->endpoint().port();
|
1394
|
-
CB_LOG_DEBUG("{} connecting to {}:{}, timeout={}ms",
|
1394
|
+
CB_LOG_DEBUG("{} connecting to {}:{} (\"{}:{}\"), timeout={}ms",
|
1395
|
+
log_prefix_,
|
1396
|
+
hostname,
|
1397
|
+
port,
|
1398
|
+
bootstrap_hostname_,
|
1399
|
+
bootstrap_port_,
|
1400
|
+
origin_.options().connect_timeout.count());
|
1395
1401
|
connection_deadline_.expires_after(origin_.options().connect_timeout);
|
1396
1402
|
connection_deadline_.async_wait([self = shared_from_this(), hostname, port](const auto timer_ec) {
|
1397
1403
|
if (timer_ec == asio::error::operation_aborted || self->stopped_) {
|
1398
1404
|
return;
|
1399
1405
|
}
|
1400
|
-
CB_LOG_DEBUG("{} unable to connect to {}:{} in time, reconnecting",
|
1406
|
+
CB_LOG_DEBUG("{} unable to connect to {}:{} (\"{}:{}\") in time, reconnecting",
|
1407
|
+
self->log_prefix_,
|
1408
|
+
hostname,
|
1409
|
+
port,
|
1410
|
+
self->bootstrap_hostname_,
|
1411
|
+
self->bootstrap_port_);
|
1401
1412
|
return self->stream_->close([self](std::error_code) { self->initiate_bootstrap(); });
|
1402
1413
|
});
|
1403
1414
|
stream_->async_connect(it->endpoint(),
|
1404
1415
|
std::bind(&mcbp_session_impl::on_connect, shared_from_this(), std::placeholders::_1, it));
|
1405
1416
|
} else {
|
1406
|
-
CB_LOG_ERROR("{} no more endpoints left to connect, will try another address",
|
1417
|
+
CB_LOG_ERROR("{} no more endpoints left to connect to \"{}:{}\", will try another address",
|
1418
|
+
log_prefix_,
|
1419
|
+
bootstrap_hostname_,
|
1420
|
+
bootstrap_port_);
|
1407
1421
|
if (state_listener_) {
|
1408
1422
|
state_listener_->report_bootstrap_error(fmt::format("{}:{}", bootstrap_hostname_, bootstrap_port_),
|
1409
1423
|
errc::network::no_endpoints_left);
|
@@ -1453,6 +1467,7 @@ class mcbp_session_impl
|
|
1453
1467
|
bootstrap_hostname_,
|
1454
1468
|
connection_endpoints_.remote_address,
|
1455
1469
|
connection_endpoints_.remote.port());
|
1470
|
+
parser_.reset();
|
1456
1471
|
bootstrap_handler_ = std::make_shared<bootstrap_handler>(shared_from_this());
|
1457
1472
|
connection_deadline_.cancel();
|
1458
1473
|
}
|
@@ -1602,6 +1617,7 @@ class mcbp_session_impl
|
|
1602
1617
|
asio::steady_timer bootstrap_deadline_;
|
1603
1618
|
asio::steady_timer connection_deadline_;
|
1604
1619
|
asio::steady_timer retry_backoff_;
|
1620
|
+
asio::steady_timer ping_deadline_;
|
1605
1621
|
couchbase::core::origin origin_;
|
1606
1622
|
std::optional<std::string> bucket_name_;
|
1607
1623
|
mcbp_parser parser_;
|
@@ -1827,9 +1843,9 @@ mcbp_session::supported_features() const
|
|
1827
1843
|
}
|
1828
1844
|
|
1829
1845
|
void
|
1830
|
-
mcbp_session::ping(std::shared_ptr<diag::ping_reporter> handler) const
|
1846
|
+
mcbp_session::ping(std::shared_ptr<diag::ping_reporter> handler, std::optional<std::chrono::milliseconds> timeout) const
|
1831
1847
|
{
|
1832
|
-
return impl_->ping(std::move(handler));
|
1848
|
+
return impl_->ping(std::move(handler), std::move(timeout));
|
1833
1849
|
}
|
1834
1850
|
|
1835
1851
|
bool
|
@@ -1862,4 +1878,10 @@ mcbp_session::write_and_subscribe(std::shared_ptr<mcbp::queue_request> request,
|
|
1862
1878
|
return impl_->write_and_subscribe(std::move(request), std::move(handler));
|
1863
1879
|
}
|
1864
1880
|
|
1881
|
+
void
|
1882
|
+
mcbp_session::write_and_flush(std::vector<std::byte>&& buffer)
|
1883
|
+
{
|
1884
|
+
return impl_->write_and_flush(std::move(buffer));
|
1885
|
+
}
|
1886
|
+
|
1865
1887
|
} // namespace couchbase::core::io
|
@@ -23,6 +23,7 @@
|
|
23
23
|
#include "mcbp_context.hxx"
|
24
24
|
#include "mcbp_message.hxx"
|
25
25
|
|
26
|
+
#include <chrono>
|
26
27
|
#include <cinttypes>
|
27
28
|
#include <memory>
|
28
29
|
#include <optional>
|
@@ -108,6 +109,7 @@ class mcbp_session
|
|
108
109
|
[[nodiscard]] const std::string& bootstrap_hostname() const;
|
109
110
|
[[nodiscard]] const std::string& bootstrap_port() const;
|
110
111
|
[[nodiscard]] std::uint16_t bootstrap_port_number() const;
|
112
|
+
void write_and_flush(std::vector<std::byte>&& buffer);
|
111
113
|
void write_and_subscribe(std::shared_ptr<mcbp::queue_request>, std::shared_ptr<response_handler> handler);
|
112
114
|
void write_and_subscribe(std::uint32_t opaque, std::vector<std::byte>&& data, command_handler&& handler);
|
113
115
|
void bootstrap(utils::movable_function<void(std::error_code, topology::configuration)>&& handler,
|
@@ -118,7 +120,7 @@ class mcbp_session
|
|
118
120
|
[[nodiscard]] bool has_config() const;
|
119
121
|
[[nodiscard]] diag::endpoint_diag_info diag_info() const;
|
120
122
|
void on_configuration_update(std::shared_ptr<config_listener> handler);
|
121
|
-
void ping(std::shared_ptr<diag::ping_reporter> handler) const;
|
123
|
+
void ping(std::shared_ptr<diag::ping_reporter> handler, std::optional<std::chrono::milliseconds> = {}) const;
|
122
124
|
[[nodiscard]] bool supports_gcccp() const;
|
123
125
|
[[nodiscard]] std::optional<key_value_error_map_info> decode_error_code(std::uint16_t code);
|
124
126
|
void handle_not_my_vbucket(const io::mcbp_message& msg) const;
|
@@ -30,7 +30,7 @@ static const std::string protocol_logger_name{ "couchbase_cxx_client_protocol_lo
|
|
30
30
|
* This pattern is duplicated for some test cases. If you need to update it,
|
31
31
|
* please also update in all relevant places.
|
32
32
|
*/
|
33
|
-
static const std::string log_pattern{ "[%Y-%m-%d %T.%e]
|
33
|
+
static const std::string log_pattern{ "[%Y-%m-%d %T.%e] %4oms [%^%4!l%$] [%P,%t] %v" };
|
34
34
|
|
35
35
|
/**
|
36
36
|
* Instances of spdlog (async) file logger.
|
@@ -178,16 +178,16 @@ log_protocol(const char* file, int line, const char* function, std::string_view
|
|
178
178
|
* @param msg message to log
|
179
179
|
* @param args the formatting arguments
|
180
180
|
*/
|
181
|
-
template<typename
|
181
|
+
template<typename... Args>
|
182
182
|
inline void
|
183
|
-
log(const char* file, int line, const char* function, level lvl,
|
183
|
+
log(const char* file, int line, const char* function, level lvl, fmt::format_string<Args...> msg, Args&&... args)
|
184
184
|
{
|
185
185
|
detail::log(file, line, function, lvl, fmt::format(msg, std::forward<Args>(args)...));
|
186
186
|
}
|
187
187
|
|
188
|
-
template<typename
|
188
|
+
template<typename... Args>
|
189
189
|
inline void
|
190
|
-
log_protocol(const char* file, int line, const char* function,
|
190
|
+
log_protocol(const char* file, int line, const char* function, fmt::format_string<Args...> msg, Args&&... args)
|
191
191
|
{
|
192
192
|
detail::log_protocol(file, line, function, fmt::format(msg, std::forward<Args>(args)...));
|
193
193
|
}
|
@@ -116,7 +116,7 @@ struct bucket_settings {
|
|
116
116
|
bucket_eviction_policy eviction_policy{ bucket_eviction_policy::unknown };
|
117
117
|
bucket_conflict_resolution conflict_resolution_type{ bucket_conflict_resolution::unknown };
|
118
118
|
std::optional<bool> history_retention_collection_default{};
|
119
|
-
std::optional<std::uint32_t> history_retention_bytes;
|
119
|
+
std::optional<std::uint32_t> history_retention_bytes{};
|
120
120
|
std::optional<std::uint32_t> history_retention_duration{};
|
121
121
|
|
122
122
|
/**
|
@@ -73,3 +73,41 @@
|
|
73
73
|
#define COUCHBASE_CXX_CLIENT_HAS_COLLECTION_QUERY_INDEX_MANAGEMENT 1
|
74
74
|
|
75
75
|
#define COUCHBASE_CXX_CLIENT_TRANSACTIONS_EXT_PARALLEL_UNSTAGING
|
76
|
+
|
77
|
+
/**
|
78
|
+
* core cluster implementation has been hidden and not accessible through the public API
|
79
|
+
*/
|
80
|
+
#define COUCHBASE_CXX_CLIENT_HAS_CORE_CLUSTER_HIDDEN 1
|
81
|
+
|
82
|
+
/**
|
83
|
+
* expiration_time has been renamed to timeout in transactions_options and transactions_config
|
84
|
+
* kv_timeout removed from transactions_options and transactions_config
|
85
|
+
*/
|
86
|
+
#define COUCHBASE_CXX_CLIENT_TRANSACTIONS_OPTIONS_HAVE_TIMEOUT 1
|
87
|
+
|
88
|
+
/**
|
89
|
+
* Search index management is accessible from the public API
|
90
|
+
* couchbase::cluster::search_indexes() support
|
91
|
+
*/
|
92
|
+
#define COUCHBASE_CXX_CLIENT_HAS_PUBLIC_SEARCH_INDEX_MANAGEMENT 1
|
93
|
+
|
94
|
+
/**
|
95
|
+
* FTS is accessible from the public API
|
96
|
+
* couchbase::cluster::search_query() and couchbase::scope::search_query() support
|
97
|
+
*/
|
98
|
+
#define COUCHBASE_CXX_CLIENT_HAS_PUBLIC_SEARCH 1
|
99
|
+
|
100
|
+
/**
|
101
|
+
* The document not locked (couchbase::errc::key_value::document_not_locked) error code is supported
|
102
|
+
*/
|
103
|
+
#define COUCHBASE_CXX_CLIENT_HAS_ERRC_DOCUMENT_NOT_LOCKED 1
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Vector search is supported via couchbase::cluster::search() or couchbase::scope::search()
|
107
|
+
*/
|
108
|
+
#define COUCHBASE_CXX_CLIENT_HAS_VECTOR_SEARCH 1
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Scope level search index management is supported via couchbase::scope::search_indexes()
|
112
|
+
*/
|
113
|
+
#define COUCHBASE_CXX_CLIENT_HAS_SCOPE_SEARCH_INDEX_MANAGEMENT 1
|
@@ -26,6 +26,7 @@
|
|
26
26
|
#include <couchbase/error_codes.hxx>
|
27
27
|
|
28
28
|
#include <gsl/assert>
|
29
|
+
#include <regex>
|
29
30
|
|
30
31
|
namespace couchbase::core::operations
|
31
32
|
{
|
@@ -236,7 +237,9 @@ query_request::make_response(error_context::query&& ctx, const encoded_response_
|
|
236
237
|
response.ctx.client_context_id);
|
237
238
|
}
|
238
239
|
}
|
239
|
-
|
240
|
+
if (const auto* s = payload.find("status"); s != nullptr) {
|
241
|
+
response.meta.status = payload.at("status").get_string();
|
242
|
+
}
|
240
243
|
if (const auto* s = payload.find("signature"); s != nullptr) {
|
241
244
|
response.meta.signature = couchbase::core::utils::json::generate(*s);
|
242
245
|
}
|
@@ -324,7 +327,12 @@ query_request::make_response(error_context::query&& ctx, const encoded_response_
|
|
324
327
|
response.ctx.first_error_message = response.meta.errors->front().message;
|
325
328
|
switch (response.ctx.first_error_code) {
|
326
329
|
case 1065: /* IKey: "service.io.request.unrecognized_parameter" */
|
327
|
-
response.ctx.
|
330
|
+
if ((response.ctx.first_error_message.find("Unrecognized parameter in request") != std::string::npos) &&
|
331
|
+
(response.ctx.first_error_message.find("preserve_expiry") != std::string::npos)) {
|
332
|
+
response.ctx.ec = errc::common::feature_not_available;
|
333
|
+
} else {
|
334
|
+
response.ctx.ec = errc::common::invalid_argument;
|
335
|
+
}
|
328
336
|
break;
|
329
337
|
case 1080: /* IKey: "timeout" */
|
330
338
|
response.ctx.ec = errc::common::unambiguous_timeout;
|
@@ -342,6 +350,19 @@ query_request::make_response(error_context::query&& ctx, const encoded_response_
|
|
342
350
|
case 4090: /* IKey: "plan.build_prepared.name_not_in_encoded_plan" */
|
343
351
|
response.ctx.ec = errc::query::prepared_statement_failure;
|
344
352
|
break;
|
353
|
+
case 4300: /* IKey: "plan.new_index_already_exists" */
|
354
|
+
response.ctx.ec = errc::common::index_exists;
|
355
|
+
break;
|
356
|
+
case 5000: /* IKey: "Internal Error" */
|
357
|
+
if (std::regex_search(response.ctx.first_error_message, std::regex{ ".*[iI]ndex .*already exist.*" })) {
|
358
|
+
response.ctx.ec = errc::common::index_exists;
|
359
|
+
} else if (response.ctx.first_error_message.find("Index does not exist") != std::string::npos ||
|
360
|
+
std::regex_search(response.ctx.first_error_message, std::regex{ ".*[iI]ndex .*[nN]ot [fF]ound.*" })) {
|
361
|
+
response.ctx.ec = errc::common::index_not_found;
|
362
|
+
} else if (response.ctx.first_error_message.find("Bucket Not Found") != std::string::npos) {
|
363
|
+
response.ctx.ec = errc::common::bucket_not_found;
|
364
|
+
}
|
365
|
+
break;
|
345
366
|
case 12009: /* IKey: "datastore.couchbase.DML_error" */
|
346
367
|
if (response.ctx.first_error_message.find("CAS mismatch") != std::string::npos) {
|
347
368
|
response.ctx.ec = errc::common::cas_mismatch;
|
@@ -34,6 +34,25 @@ search_request::encode_to(search_request::encoded_request_type& encoded, http_co
|
|
34
34
|
{ "query", utils::json::parse(query) },
|
35
35
|
{ "ctl", { { "timeout", encoded.timeout.count() } } },
|
36
36
|
};
|
37
|
+
|
38
|
+
if (show_request.has_value()) {
|
39
|
+
body["showrequest"] = show_request.value() ? "true" : "false";
|
40
|
+
}
|
41
|
+
|
42
|
+
if (vector_search.has_value()) {
|
43
|
+
body["knn"] = utils::json::parse(vector_search.value());
|
44
|
+
}
|
45
|
+
if (vector_query_combination.has_value()) {
|
46
|
+
switch (*vector_query_combination) {
|
47
|
+
case couchbase::core::vector_query_combination::combination_or:
|
48
|
+
body["knn_operator"] = "or";
|
49
|
+
break;
|
50
|
+
case couchbase::core::vector_query_combination::combination_and:
|
51
|
+
body["knn_operator"] = "and";
|
52
|
+
break;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
37
56
|
if (explain) {
|
38
57
|
body["explain"] = *explain;
|
39
58
|
}
|
@@ -103,10 +122,15 @@ search_request::encode_to(search_request::encoded_request_type& encoded, http_co
|
|
103
122
|
body[key] = utils::json::parse(value);
|
104
123
|
}
|
105
124
|
|
125
|
+
if (bucket_name.has_value() && scope_name.has_value()) {
|
126
|
+
encoded.path = fmt::format("/api/bucket/{}/scope/{}/index/{}/query", bucket_name.value(), scope_name.value(), index_name);
|
127
|
+
} else {
|
128
|
+
encoded.path = fmt::format("/api/index/{}/query", index_name);
|
129
|
+
}
|
130
|
+
|
106
131
|
encoded.type = type;
|
107
132
|
encoded.headers["content-type"] = "application/json";
|
108
133
|
encoded.method = "POST";
|
109
|
-
encoded.path = fmt::format("/api/index/{}/query", index_name);
|
110
134
|
body_str = utils::json::generate(body);
|
111
135
|
encoded.body = body_str;
|
112
136
|
if (context.options.show_queries) {
|
@@ -310,6 +334,18 @@ search_request::make_response(error_context::search&& ctx, const encoded_respons
|
|
310
334
|
response.ctx.ec = errc::common::rate_limited;
|
311
335
|
return response;
|
312
336
|
}
|
337
|
+
} else if (encoded.status_code == 404) {
|
338
|
+
tao::json::value payload{};
|
339
|
+
try {
|
340
|
+
payload = utils::json::parse(encoded.body.data());
|
341
|
+
} catch (const tao::pegtl::parse_error&) {
|
342
|
+
response.ctx.ec = errc::common::parsing_failure;
|
343
|
+
return response;
|
344
|
+
}
|
345
|
+
response.status = payload.at("status").get_string();
|
346
|
+
response.error = payload.at("error").get_string();
|
347
|
+
response.ctx.ec = errc::common::feature_not_available;
|
348
|
+
return response;
|
313
349
|
}
|
314
350
|
response.ctx.ec = errc::common::internal_server_failure;
|
315
351
|
}
|
@@ -27,6 +27,7 @@
|
|
27
27
|
#include "core/search_highlight_style.hxx"
|
28
28
|
#include "core/search_scan_consistency.hxx"
|
29
29
|
#include "core/timeout_defaults.hxx"
|
30
|
+
#include "core/vector_query_combination.hxx"
|
30
31
|
|
31
32
|
#include <couchbase/mutation_token.hxx>
|
32
33
|
|
@@ -118,6 +119,16 @@ struct search_request {
|
|
118
119
|
|
119
120
|
std::string index_name;
|
120
121
|
couchbase::core::json_string query;
|
122
|
+
std::optional<std::string> bucket_name;
|
123
|
+
std::optional<std::string> scope_name;
|
124
|
+
|
125
|
+
/**
|
126
|
+
* UNCOMMITTED: This should be set to false if using the .search() API, leave unset for old .search_query() API
|
127
|
+
*/
|
128
|
+
std::optional<bool> show_request;
|
129
|
+
|
130
|
+
std::optional<couchbase::core::json_string> vector_search;
|
131
|
+
std::optional<couchbase::core::vector_query_combination> vector_query_combination;
|
121
132
|
|
122
133
|
std::optional<std::uint32_t> limit{};
|
123
134
|
std::optional<std::uint32_t> skip{};
|