couchbase 3.7.0 → 3.8.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/CMakeLists.txt +4 -1
- data/ext/cache/extconf_include.rb +4 -3
- data/ext/cache/mozilla-ca-bundle.crt +66 -93
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/couchbase/CMakeLists.txt +24 -11
- data/ext/couchbase/cmake/APKBUILD.in +17 -1
- data/ext/couchbase/cmake/Bundler.cmake +9 -1
- data/ext/couchbase/cmake/Cache.cmake +48 -19
- data/ext/couchbase/cmake/CompilerOptions.cmake +3 -1
- data/ext/couchbase/cmake/OpenSSL.cmake +10 -2
- data/ext/couchbase/cmake/Packaging.cmake +48 -8
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +43 -1
- data/ext/couchbase/cmake/build_config.hxx.in +2 -0
- data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +18 -0
- data/ext/couchbase/cmake/tarball_glob.txt +10 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +1 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +45 -43
- data/ext/couchbase/core/app_telemetry_reporter.hxx +4 -3
- data/ext/couchbase/core/bucket.cxx +128 -13
- data/ext/couchbase/core/bucket.hxx +12 -2
- data/ext/couchbase/core/cluster.cxx +304 -152
- data/ext/couchbase/core/cluster.hxx +32 -0
- data/ext/couchbase/core/cluster_credentials.cxx +25 -0
- data/ext/couchbase/core/cluster_credentials.hxx +5 -0
- data/ext/couchbase/core/cluster_label_listener.cxx +72 -0
- data/ext/couchbase/core/cluster_label_listener.hxx +46 -0
- data/ext/couchbase/core/cluster_options.hxx +4 -0
- data/ext/couchbase/core/deprecation_utils.hxx +26 -0
- data/ext/couchbase/core/error.hxx +27 -0
- data/ext/couchbase/core/free_form_http_request.hxx +0 -2
- data/ext/couchbase/core/http_component.cxx +12 -48
- data/ext/couchbase/core/impl/analytics.cxx +3 -2
- data/ext/couchbase/core/impl/analytics.hxx +2 -1
- data/ext/couchbase/core/impl/analytics_index_manager.cxx +249 -137
- data/ext/couchbase/core/impl/binary_collection.cxx +134 -58
- data/ext/couchbase/core/impl/bucket_manager.cxx +87 -35
- data/ext/couchbase/core/impl/collection.cxx +560 -245
- data/ext/couchbase/core/impl/collection_manager.cxx +89 -49
- data/ext/couchbase/core/impl/dns_srv_tracker.cxx +4 -4
- data/ext/couchbase/core/impl/error.cxx +20 -13
- data/ext/couchbase/core/impl/error.hxx +15 -10
- data/ext/couchbase/core/impl/get_all_replicas.hxx +1 -1
- data/ext/couchbase/core/impl/get_any_replica.hxx +2 -1
- data/ext/couchbase/core/impl/get_replica.hxx +2 -0
- data/ext/couchbase/core/impl/lookup_in_replica.hxx +1 -1
- data/ext/couchbase/core/impl/observability_recorder.cxx +161 -0
- data/ext/couchbase/core/impl/observability_recorder.hxx +77 -0
- data/ext/couchbase/core/impl/observe_seqno.hxx +2 -0
- data/ext/couchbase/core/impl/public_bucket.cxx +31 -7
- data/ext/couchbase/core/impl/public_cluster.cxx +107 -19
- data/ext/couchbase/core/impl/query.cxx +6 -3
- data/ext/couchbase/core/impl/query.hxx +3 -1
- data/ext/couchbase/core/impl/query_index_manager.cxx +267 -102
- data/ext/couchbase/core/impl/scope.cxx +53 -11
- data/ext/couchbase/core/impl/search.cxx +8 -4
- data/ext/couchbase/core/impl/search.hxx +6 -2
- data/ext/couchbase/core/impl/search_index_manager.cxx +131 -41
- data/ext/couchbase/core/impl/with_cancellation.hxx +75 -0
- data/ext/couchbase/core/io/config_tracker.cxx +9 -9
- data/ext/couchbase/core/io/config_tracker.hxx +2 -1
- data/ext/couchbase/core/io/http_command.hxx +98 -49
- data/ext/couchbase/core/io/http_context.hxx +2 -0
- data/ext/couchbase/core/io/http_session.cxx +23 -10
- data/ext/couchbase/core/io/http_session.hxx +17 -9
- data/ext/couchbase/core/io/http_session_manager.hxx +163 -228
- data/ext/couchbase/core/io/http_traits.hxx +0 -7
- data/ext/couchbase/core/io/mcbp_command.hxx +123 -44
- data/ext/couchbase/core/io/mcbp_session.cxx +251 -26
- data/ext/couchbase/core/io/mcbp_session.hxx +9 -1
- data/ext/couchbase/core/io/mcbp_traits.hxx +0 -8
- data/ext/couchbase/core/io/streams.cxx +3 -3
- data/ext/couchbase/core/io/streams.hxx +3 -2
- data/ext/couchbase/core/meta/features.hxx +15 -0
- data/ext/couchbase/core/meta/version.cxx +13 -0
- data/ext/couchbase/core/meta/version.hxx +3 -0
- data/ext/couchbase/core/metrics/constants.hxx +23 -0
- data/ext/couchbase/core/metrics/logging_meter.cxx +5 -5
- data/ext/couchbase/core/metrics/meter_wrapper.cxx +65 -63
- data/ext/couchbase/core/metrics/meter_wrapper.hxx +12 -10
- data/ext/couchbase/core/operations/document_analytics.hxx +0 -5
- data/ext/couchbase/core/operations/document_append.hxx +0 -4
- data/ext/couchbase/core/operations/document_decrement.hxx +0 -5
- data/ext/couchbase/core/operations/document_exists.hxx +0 -7
- data/ext/couchbase/core/operations/document_get.hxx +0 -7
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +77 -27
- data/ext/couchbase/core/operations/document_get_and_lock.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_and_touch.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_any_replica.hxx +83 -2
- data/ext/couchbase/core/operations/document_get_projected.hxx +0 -9
- data/ext/couchbase/core/operations/document_increment.hxx +0 -5
- data/ext/couchbase/core/operations/document_insert.hxx +0 -4
- data/ext/couchbase/core/operations/document_lookup_in.hxx +0 -9
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +46 -4
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +121 -43
- data/ext/couchbase/core/operations/document_mutate_in.hxx +0 -5
- data/ext/couchbase/core/operations/document_prepend.hxx +0 -4
- data/ext/couchbase/core/operations/document_query.hxx +0 -4
- data/ext/couchbase/core/operations/document_remove.hxx +0 -4
- data/ext/couchbase/core/operations/document_replace.hxx +0 -4
- data/ext/couchbase/core/operations/document_search.hxx +0 -7
- data/ext/couchbase/core/operations/document_touch.hxx +0 -7
- data/ext/couchbase/core/operations/document_unlock.hxx +0 -6
- data/ext/couchbase/core/operations/document_upsert.hxx +0 -4
- data/ext/couchbase/core/operations/document_view.cxx +2 -0
- data/ext/couchbase/core/operations/document_view.hxx +10 -13
- data/ext/couchbase/core/operations/http_noop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_flush.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/change_password.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/error_utils.cxx +4 -1
- data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_status.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/freeform.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +68 -30
- data/ext/couchbase/core/operations/management/query_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_get_all.hxx +4 -3
- data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +2 -1
- data/ext/couchbase/core/operations/management/role_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_query.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/operation_traits.hxx +6 -0
- data/ext/couchbase/core/operations.hxx +0 -1
- data/ext/couchbase/core/operations_fwd.hxx +8 -0
- data/ext/couchbase/core/origin.cxx +67 -12
- data/ext/couchbase/core/origin.hxx +13 -8
- data/ext/couchbase/core/orphan_reporter.cxx +164 -0
- data/ext/couchbase/core/orphan_reporter.hxx +65 -0
- data/ext/couchbase/core/sasl/CMakeLists.txt +1 -0
- data/ext/couchbase/core/sasl/client.cc +6 -0
- data/ext/couchbase/core/sasl/mechanism.cc +2 -1
- data/ext/couchbase/core/sasl/mechanism.h +2 -1
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.cc +41 -0
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.h +47 -0
- data/ext/couchbase/core/tls_context_provider.cxx +44 -0
- data/ext/couchbase/core/tls_context_provider.hxx +44 -0
- data/ext/couchbase/core/tracing/attribute_helpers.hxx +45 -0
- data/ext/couchbase/core/tracing/constants.hxx +148 -68
- data/ext/couchbase/core/tracing/threshold_logging_options.hxx +0 -3
- data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +122 -170
- data/ext/couchbase/core/tracing/tracer_wrapper.cxx +17 -24
- data/ext/couchbase/core/tracing/tracer_wrapper.hxx +8 -10
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.cxx +114 -0
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.hxx +85 -0
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +16 -14
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +4 -4
- data/ext/couchbase/core/transactions/transactions.cxx +1 -1
- data/ext/couchbase/core/transactions/transactions_cleanup.cxx +1 -2
- data/ext/couchbase/core/utils/byteswap.hxx +12 -0
- data/ext/couchbase/core/utils/concurrent_fixed_priority_queue.hxx +102 -0
- data/ext/couchbase/core/utils/connection_string.cxx +2 -0
- data/ext/couchbase/couchbase/certificate_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/cluster.hxx +47 -0
- data/ext/couchbase/couchbase/cluster_options.hxx +16 -0
- data/ext/couchbase/couchbase/collection.hxx +60 -15
- data/ext/couchbase/couchbase/error_codes.hxx +48 -48
- data/ext/couchbase/couchbase/jwt_authenticator.hxx +52 -0
- data/ext/couchbase/couchbase/metrics/meter.hxx +2 -1
- data/ext/couchbase/couchbase/metrics/otel_meter.hxx +75 -80
- data/ext/couchbase/couchbase/network_options.hxx +19 -0
- data/ext/couchbase/couchbase/password_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +15 -17
- data/ext/couchbase/couchbase/tracing/request_span.hxx +2 -2
- data/ext/couchbase.cxx +4 -0
- data/ext/extconf.rb +1 -0
- data/ext/rcb_analytics.cxx +157 -47
- data/ext/rcb_backend.cxx +118 -71
- data/ext/rcb_buckets.cxx +39 -16
- data/ext/rcb_collections.cxx +36 -12
- data/ext/rcb_crud.cxx +587 -294
- data/ext/rcb_hdr_histogram.cxx +219 -0
- data/ext/rcb_hdr_histogram.hxx +28 -0
- data/ext/rcb_multi.cxx +142 -59
- data/ext/rcb_observability.cxx +132 -0
- data/ext/rcb_observability.hxx +49 -0
- data/ext/rcb_query.cxx +77 -27
- data/ext/rcb_search.cxx +92 -31
- data/ext/rcb_users.cxx +69 -26
- data/ext/rcb_utils.cxx +91 -0
- data/ext/rcb_utils.hxx +141 -168
- data/ext/rcb_views.cxx +36 -12
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +37 -22
- data/lib/couchbase/bucket.rb +46 -31
- data/lib/couchbase/cluster.rb +146 -61
- data/lib/couchbase/collection.rb +257 -186
- data/lib/couchbase/datastructures/couchbase_list.rb +81 -50
- data/lib/couchbase/datastructures/couchbase_map.rb +86 -50
- data/lib/couchbase/datastructures/couchbase_queue.rb +64 -38
- data/lib/couchbase/datastructures/couchbase_set.rb +57 -41
- data/lib/couchbase/deprecations.rb +1 -1
- data/lib/couchbase/diagnostics.rb +8 -8
- data/lib/couchbase/errors.rb +6 -0
- data/lib/couchbase/management/analytics_index_manager.rb +90 -59
- data/lib/couchbase/management/bucket_manager.rb +73 -45
- data/lib/couchbase/management/collection_manager.rb +86 -43
- data/lib/couchbase/management/collection_query_index_manager.rb +56 -33
- data/lib/couchbase/management/query_index_manager.rb +88 -36
- data/lib/couchbase/management/scope_search_index_manager.rb +119 -52
- data/lib/couchbase/management/search_index_manager.rb +401 -178
- data/lib/couchbase/management/user_manager.rb +343 -174
- data/lib/couchbase/management/view_index_manager.rb +166 -73
- data/lib/couchbase/metrics/logging_meter.rb +108 -0
- data/lib/couchbase/metrics/logging_value_recorder.rb +50 -0
- data/lib/couchbase/metrics/meter.rb +27 -0
- data/lib/couchbase/metrics/noop_meter.rb +30 -0
- data/lib/couchbase/metrics/noop_value_recorder.rb +27 -0
- data/lib/couchbase/metrics/value_recorder.rb +25 -0
- data/lib/couchbase/options.rb +69 -3
- data/lib/couchbase/protostellar/cluster.rb +3 -0
- data/lib/couchbase/scope.rb +62 -48
- data/lib/couchbase/search_options.rb +18 -18
- data/lib/couchbase/tracing/noop_span.rb +29 -0
- data/lib/couchbase/tracing/noop_tracer.rb +29 -0
- data/lib/couchbase/tracing/request_span.rb +34 -0
- data/lib/couchbase/tracing/request_tracer.rb +28 -0
- data/lib/couchbase/tracing/threshold_logging_span.rb +112 -0
- data/lib/couchbase/tracing/threshold_logging_tracer.rb +231 -0
- data/lib/couchbase/utils/hdr_histogram.rb +55 -0
- data/lib/couchbase/utils/observability.rb +257 -0
- data/lib/couchbase/utils/observability_constants.rb +200 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -3
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase.rb +2 -2
- metadata +58 -6
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#include "core/cluster.hxx"
|
|
19
19
|
|
|
20
20
|
#include "core/impl/error.hxx"
|
|
21
|
+
#include "core/impl/observability_recorder.hxx"
|
|
21
22
|
#include "core/operations/management/search_index_analyze_document.hxx"
|
|
22
23
|
#include "core/operations/management/search_index_control_ingest.hxx"
|
|
23
24
|
#include "core/operations/management/search_index_control_plan_freeze.hxx"
|
|
@@ -27,6 +28,8 @@
|
|
|
27
28
|
#include "core/operations/management/search_index_get_all.hxx"
|
|
28
29
|
#include "core/operations/management/search_index_get_documents_count.hxx"
|
|
29
30
|
#include "core/operations/management/search_index_upsert.hxx"
|
|
31
|
+
#include "core/tracing/constants.hxx"
|
|
32
|
+
#include "core/tracing/tracer_wrapper.hxx"
|
|
30
33
|
#include "core/utils/json.hxx"
|
|
31
34
|
|
|
32
35
|
#include <couchbase/scope_search_index_manager.hxx>
|
|
@@ -147,10 +150,17 @@ public:
|
|
|
147
150
|
const couchbase::get_search_index_options::built& options,
|
|
148
151
|
get_search_index_handler&& handler) const
|
|
149
152
|
{
|
|
153
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_get_index,
|
|
154
|
+
options.parent_span);
|
|
155
|
+
|
|
156
|
+
core::operations::management::search_index_get_request request{
|
|
157
|
+
std::move(index_name), bucket_name_, scope_name_, {}, options.timeout,
|
|
158
|
+
obs_rec->operation_span(),
|
|
159
|
+
};
|
|
150
160
|
core_.execute(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
std::move(request),
|
|
162
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
163
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
154
164
|
return handler(core::impl::make_error(resp.ctx), map_search_index(resp.index));
|
|
155
165
|
});
|
|
156
166
|
}
|
|
@@ -158,10 +168,15 @@ public:
|
|
|
158
168
|
void get_all_indexes(const get_all_search_indexes_options::built& options,
|
|
159
169
|
get_all_search_indexes_handler&& handler) const
|
|
160
170
|
{
|
|
171
|
+
auto obs_rec = create_observability_recorder(
|
|
172
|
+
core::tracing::operation::mgr_search_get_all_indexes, options.parent_span);
|
|
173
|
+
core::operations::management::search_index_get_all_request request{
|
|
174
|
+
bucket_name_, scope_name_, {}, options.timeout, obs_rec->operation_span(),
|
|
175
|
+
};
|
|
161
176
|
core_.execute(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
177
|
+
std::move(request),
|
|
178
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
179
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
165
180
|
return handler(core::impl::make_error(resp.ctx), map_all_search_indexes(resp.indexes));
|
|
166
181
|
});
|
|
167
182
|
}
|
|
@@ -170,10 +185,16 @@ public:
|
|
|
170
185
|
const upsert_search_index_options::built& options,
|
|
171
186
|
upsert_search_index_handler&& handler) const
|
|
172
187
|
{
|
|
188
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_upsert_index,
|
|
189
|
+
options.parent_span);
|
|
190
|
+
core::operations::management::search_index_upsert_request request{
|
|
191
|
+
map_search_index(search_index), bucket_name_, scope_name_, {}, options.timeout,
|
|
192
|
+
obs_rec->operation_span(),
|
|
193
|
+
};
|
|
173
194
|
core_.execute(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
195
|
+
std::move(request),
|
|
196
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
197
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
177
198
|
return handler(core::impl::make_error(resp.ctx));
|
|
178
199
|
});
|
|
179
200
|
}
|
|
@@ -182,10 +203,16 @@ public:
|
|
|
182
203
|
const drop_search_index_options::built& options,
|
|
183
204
|
drop_search_index_handler&& handler) const
|
|
184
205
|
{
|
|
206
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_drop_index,
|
|
207
|
+
options.parent_span);
|
|
208
|
+
core::operations::management::search_index_drop_request request{
|
|
209
|
+
std::move(index_name), bucket_name_, scope_name_, {}, options.timeout,
|
|
210
|
+
obs_rec->operation_span(),
|
|
211
|
+
};
|
|
185
212
|
core_.execute(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
213
|
+
std::move(request),
|
|
214
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
215
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
189
216
|
return handler(core::impl::make_error(resp.ctx));
|
|
190
217
|
});
|
|
191
218
|
}
|
|
@@ -194,10 +221,16 @@ public:
|
|
|
194
221
|
const get_indexed_search_index_options::built& options,
|
|
195
222
|
get_indexed_search_index_handler&& handler) const
|
|
196
223
|
{
|
|
224
|
+
auto obs_rec = create_observability_recorder(
|
|
225
|
+
core::tracing::operation::mgr_search_get_indexed_documents_count, options.parent_span);
|
|
226
|
+
core::operations::management::search_index_get_documents_count_request request{
|
|
227
|
+
std::move(index_name), bucket_name_, scope_name_, {}, options.timeout,
|
|
228
|
+
obs_rec->operation_span(),
|
|
229
|
+
};
|
|
197
230
|
core_.execute(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
231
|
+
std::move(request),
|
|
232
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
233
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
201
234
|
return handler(core::impl::make_error(resp.ctx), resp.count);
|
|
202
235
|
});
|
|
203
236
|
}
|
|
@@ -206,10 +239,16 @@ public:
|
|
|
206
239
|
const pause_ingest_search_index_options::built& options,
|
|
207
240
|
pause_ingest_search_index_handler&& handler) const
|
|
208
241
|
{
|
|
242
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_pause_ingest,
|
|
243
|
+
options.parent_span);
|
|
244
|
+
core::operations::management::search_index_control_ingest_request request{
|
|
245
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout,
|
|
246
|
+
obs_rec->operation_span(),
|
|
247
|
+
};
|
|
209
248
|
core_.execute(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
249
|
+
std::move(request),
|
|
250
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
251
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
213
252
|
return handler(core::impl::make_error(resp.ctx));
|
|
214
253
|
});
|
|
215
254
|
}
|
|
@@ -218,10 +257,16 @@ public:
|
|
|
218
257
|
const resume_ingest_search_index_options::built& options,
|
|
219
258
|
resume_ingest_search_index_handler&& handler) const
|
|
220
259
|
{
|
|
260
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_resume_ingest,
|
|
261
|
+
options.parent_span);
|
|
262
|
+
core::operations::management::search_index_control_ingest_request request{
|
|
263
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout,
|
|
264
|
+
obs_rec->operation_span(),
|
|
265
|
+
};
|
|
221
266
|
core_.execute(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
267
|
+
std::move(request),
|
|
268
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
269
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
225
270
|
return handler(core::impl::make_error(resp.ctx));
|
|
226
271
|
});
|
|
227
272
|
}
|
|
@@ -230,10 +275,16 @@ public:
|
|
|
230
275
|
const allow_querying_search_index_options::built& options,
|
|
231
276
|
allow_querying_search_index_handler&& handler) const
|
|
232
277
|
{
|
|
278
|
+
auto obs_rec = create_observability_recorder(
|
|
279
|
+
core::tracing::operation::mgr_search_allow_querying, options.parent_span);
|
|
280
|
+
core::operations::management::search_index_control_query_request request{
|
|
281
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout,
|
|
282
|
+
obs_rec->operation_span(),
|
|
283
|
+
};
|
|
233
284
|
core_.execute(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
285
|
+
std::move(request),
|
|
286
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
287
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
237
288
|
return handler(core::impl::make_error(resp.ctx));
|
|
238
289
|
});
|
|
239
290
|
}
|
|
@@ -242,10 +293,16 @@ public:
|
|
|
242
293
|
const disallow_querying_search_index_options::built& options,
|
|
243
294
|
disallow_querying_search_index_handler&& handler) const
|
|
244
295
|
{
|
|
296
|
+
auto obs_rec = create_observability_recorder(
|
|
297
|
+
core::tracing::operation::mgr_search_disallow_querying, options.parent_span);
|
|
298
|
+
core::operations::management::search_index_control_query_request request{
|
|
299
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout,
|
|
300
|
+
obs_rec->operation_span(),
|
|
301
|
+
};
|
|
245
302
|
core_.execute(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
303
|
+
std::move(request),
|
|
304
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
305
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
249
306
|
return handler(core::impl::make_error(resp.ctx));
|
|
250
307
|
});
|
|
251
308
|
}
|
|
@@ -254,10 +311,16 @@ public:
|
|
|
254
311
|
const freeze_plan_search_index_options::built& options,
|
|
255
312
|
freeze_plan_search_index_handler&& handler) const
|
|
256
313
|
{
|
|
314
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_freeze_plan,
|
|
315
|
+
options.parent_span);
|
|
316
|
+
core::operations::management::search_index_control_plan_freeze_request request{
|
|
317
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout,
|
|
318
|
+
obs_rec->operation_span(),
|
|
319
|
+
};
|
|
257
320
|
core_.execute(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
321
|
+
std::move(request),
|
|
322
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
323
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
261
324
|
return handler(core::impl::make_error(resp.ctx));
|
|
262
325
|
});
|
|
263
326
|
}
|
|
@@ -266,10 +329,16 @@ public:
|
|
|
266
329
|
const unfreeze_plan_search_index_options::built& options,
|
|
267
330
|
unfreeze_plan_search_index_handler&& handler) const
|
|
268
331
|
{
|
|
332
|
+
auto obs_rec = create_observability_recorder(core::tracing::operation::mgr_search_unfreeze_plan,
|
|
333
|
+
options.parent_span);
|
|
334
|
+
core::operations::management::search_index_control_plan_freeze_request request{
|
|
335
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout,
|
|
336
|
+
obs_rec->operation_span(),
|
|
337
|
+
};
|
|
269
338
|
core_.execute(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
339
|
+
std::move(request),
|
|
340
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
341
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
273
342
|
return handler(core::impl::make_error(resp.ctx));
|
|
274
343
|
});
|
|
275
344
|
}
|
|
@@ -279,19 +348,40 @@ public:
|
|
|
279
348
|
const analyze_document_options::built& options,
|
|
280
349
|
analyze_document_handler&& handler) const
|
|
281
350
|
{
|
|
351
|
+
auto obs_rec = create_observability_recorder(
|
|
352
|
+
core::tracing::operation::mgr_search_analyze_document, options.parent_span);
|
|
353
|
+
core::operations::management::search_index_analyze_document_request request{
|
|
354
|
+
std::move(index_name), std::move(document), bucket_name_, scope_name_, {},
|
|
355
|
+
options.timeout, obs_rec->operation_span(),
|
|
356
|
+
};
|
|
282
357
|
core_.execute(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
options.timeout },
|
|
289
|
-
[handler = std::move(handler)](const auto& resp) mutable {
|
|
290
|
-
return handler(core::impl::make_error(resp.ctx), convert_analysis(resp.analysis));
|
|
358
|
+
std::move(request),
|
|
359
|
+
[obs_rec = std::move(obs_rec), handler = std::move(handler)](const auto& resp) mutable {
|
|
360
|
+
auto analysis = convert_analysis(resp.analysis);
|
|
361
|
+
obs_rec->finish(resp.ctx.retry_attempts, resp.ctx.ec);
|
|
362
|
+
return handler(core::impl::make_error(resp.ctx), std::move(analysis));
|
|
291
363
|
});
|
|
292
364
|
}
|
|
293
365
|
|
|
294
366
|
private:
|
|
367
|
+
[[nodiscard]] auto create_observability_recorder(
|
|
368
|
+
const std::string& operation_name,
|
|
369
|
+
const std::shared_ptr<tracing::request_span>& parent_span) const
|
|
370
|
+
-> std::unique_ptr<core::impl::observability_recorder>
|
|
371
|
+
{
|
|
372
|
+
auto rec = core::impl::observability_recorder::create(
|
|
373
|
+
operation_name, parent_span, core_.tracer(), core_.meter());
|
|
374
|
+
|
|
375
|
+
rec->with_service(core::tracing::service::search);
|
|
376
|
+
if (bucket_name_.has_value()) {
|
|
377
|
+
rec->with_bucket_name(bucket_name_.value());
|
|
378
|
+
}
|
|
379
|
+
if (scope_name_.has_value()) {
|
|
380
|
+
rec->with_scope_name(scope_name_.value());
|
|
381
|
+
}
|
|
382
|
+
return rec;
|
|
383
|
+
}
|
|
384
|
+
|
|
295
385
|
core::cluster core_;
|
|
296
386
|
std::optional<std::string> bucket_name_{};
|
|
297
387
|
std::optional<std::string> scope_name_{};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Couchbase, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#pragma once
|
|
19
|
+
|
|
20
|
+
#include "core/impl/get_replica.hxx"
|
|
21
|
+
#include "core/impl/lookup_in_replica.hxx"
|
|
22
|
+
#include "core/operations/document_get.hxx"
|
|
23
|
+
#include "core/operations/document_lookup_in.hxx"
|
|
24
|
+
#include "core/operations/operation_traits.hxx"
|
|
25
|
+
#include "core/utils/movable_function.hxx"
|
|
26
|
+
|
|
27
|
+
#include <mutex>
|
|
28
|
+
|
|
29
|
+
namespace couchbase::core
|
|
30
|
+
{
|
|
31
|
+
namespace impl
|
|
32
|
+
{
|
|
33
|
+
class cancellation_token
|
|
34
|
+
{
|
|
35
|
+
public:
|
|
36
|
+
void setup(utils::movable_function<void()> cancel_fn)
|
|
37
|
+
{
|
|
38
|
+
const std::lock_guard lock(mutex_);
|
|
39
|
+
if (cancelled_) {
|
|
40
|
+
cancel_fn();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
cancel_fn_ = std::move(cancel_fn);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void cancel()
|
|
47
|
+
{
|
|
48
|
+
utils::movable_function<void()> fn{};
|
|
49
|
+
{
|
|
50
|
+
const std::lock_guard lock(mutex_);
|
|
51
|
+
cancelled_ = true;
|
|
52
|
+
fn = std::move(cancel_fn_);
|
|
53
|
+
}
|
|
54
|
+
if (fn) {
|
|
55
|
+
fn();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private:
|
|
60
|
+
std::mutex mutex_{};
|
|
61
|
+
utils::movable_function<void()> cancel_fn_{};
|
|
62
|
+
bool cancelled_{ false };
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
template<typename kv_operation>
|
|
66
|
+
struct with_cancellation : public kv_operation {
|
|
67
|
+
const std::shared_ptr<cancellation_token> cancel_token{ std::make_shared<cancellation_token>() };
|
|
68
|
+
};
|
|
69
|
+
} // namespace impl
|
|
70
|
+
|
|
71
|
+
template<typename kv_operation>
|
|
72
|
+
struct operations::is_cancellable_operation<impl::with_cancellation<kv_operation>>
|
|
73
|
+
: public std::true_type {
|
|
74
|
+
};
|
|
75
|
+
} // namespace couchbase::core
|
|
@@ -50,7 +50,7 @@ public:
|
|
|
50
50
|
cluster_config_tracker_impl(std::string client_id,
|
|
51
51
|
couchbase::core::origin origin,
|
|
52
52
|
asio::io_context& ctx,
|
|
53
|
-
|
|
53
|
+
tls_context_provider& tls,
|
|
54
54
|
std::shared_ptr<impl::bootstrap_state_listener> state_listener,
|
|
55
55
|
std::vector<protocol::hello_feature> supported_features = {})
|
|
56
56
|
: client_id_{ std::move(client_id) }
|
|
@@ -286,9 +286,9 @@ private:
|
|
|
286
286
|
const std::scoped_lock lock(sessions_mutex_);
|
|
287
287
|
|
|
288
288
|
if (sessions_.empty()) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
CB_LOG_DEBUG(R"({} unable to find connected session (sessions_ is empty), retry in {})",
|
|
290
|
+
log_prefix_,
|
|
291
|
+
heartbeat_interval_);
|
|
292
292
|
return;
|
|
293
293
|
}
|
|
294
294
|
|
|
@@ -307,9 +307,9 @@ private:
|
|
|
307
307
|
req.opaque(session->next_opaque());
|
|
308
308
|
session->write_and_flush(req.data());
|
|
309
309
|
} else {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
CB_LOG_DEBUG(R"({} unable to find connected session with GCCCP support, retry in {})",
|
|
311
|
+
log_prefix_,
|
|
312
|
+
heartbeat_interval_);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
@@ -559,7 +559,7 @@ private:
|
|
|
559
559
|
couchbase::core::origin origin_{};
|
|
560
560
|
std::string log_prefix_{};
|
|
561
561
|
asio::io_context& ctx_;
|
|
562
|
-
|
|
562
|
+
tls_context_provider& tls_;
|
|
563
563
|
|
|
564
564
|
asio::steady_timer heartbeat_timer_;
|
|
565
565
|
std::chrono::milliseconds heartbeat_interval_;
|
|
@@ -591,7 +591,7 @@ cluster_config_tracker::cluster_config_tracker(
|
|
|
591
591
|
std::string client_id,
|
|
592
592
|
couchbase::core::origin origin,
|
|
593
593
|
asio::io_context& ctx,
|
|
594
|
-
|
|
594
|
+
tls_context_provider& tls,
|
|
595
595
|
std::shared_ptr<impl::bootstrap_state_listener> state_listener)
|
|
596
596
|
: impl_{ std::make_shared<cluster_config_tracker_impl>(std::move(client_id),
|
|
597
597
|
std::move(origin),
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
#endif
|
|
24
24
|
#include "core/config_listener.hxx"
|
|
25
25
|
#include "core/protocol/hello_feature.hxx"
|
|
26
|
+
#include "core/tls_context_provider.hxx"
|
|
26
27
|
#include "core/utils/movable_function.hxx"
|
|
27
28
|
|
|
28
29
|
#include <mutex>
|
|
@@ -90,7 +91,7 @@ public:
|
|
|
90
91
|
cluster_config_tracker(std::string client_id,
|
|
91
92
|
couchbase::core::origin origin,
|
|
92
93
|
asio::io_context& ctx,
|
|
93
|
-
|
|
94
|
+
tls_context_provider& tls,
|
|
94
95
|
std::shared_ptr<impl::bootstrap_state_listener> state_listener);
|
|
95
96
|
~cluster_config_tracker() override;
|
|
96
97
|
|