couchbase 4.2.11 → 4.3.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.
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.crt +49 -2
- package/deps/couchbase-cxx-cache/mozilla-ca-bundle.sha256 +1 -1
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +51 -5
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +224 -209
- package/deps/couchbase-cxx-client/core/impl/query_error_context.cxx +2 -2
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +1 -0
- package/deps/couchbase-cxx-client/core/io/dns_client.cxx +4 -0
- package/deps/couchbase-cxx-client/core/io/dns_config.cxx +15 -4
- package/deps/couchbase-cxx-client/core/io/dns_config.hxx +1 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +84 -53
- package/deps/couchbase-cxx-client/core/mcbp/operation_queue.cxx +1 -0
- package/deps/couchbase-cxx-client/core/meta/features.hxx +5 -0
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +116 -105
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +116 -108
- package/deps/couchbase-cxx-client/core/operations/document_search.cxx +97 -81
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +5 -0
- package/deps/couchbase-cxx-client/core/range_scan_orchestrator_options.hxx +2 -1
- package/deps/couchbase-cxx-client/core/transactions/atr_cleanup_entry.cxx +16 -7
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_impl.cxx +578 -483
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_testing_hooks.cxx +51 -50
- package/deps/couchbase-cxx-client/core/transactions/attempt_context_testing_hooks.hxx +4 -2
- package/deps/couchbase-cxx-client/core/transactions/cleanup_testing_hooks.cxx +6 -6
- package/deps/couchbase-cxx-client/core/transactions/cleanup_testing_hooks.hxx +3 -2
- package/deps/couchbase-cxx-client/core/transactions/internal/transactions_cleanup.hxx +2 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +5 -1
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.cxx +222 -179
- package/deps/couchbase-cxx-client/core/transactions/staged_mutation.hxx +23 -12
- package/deps/couchbase-cxx-client/core/transactions/transactions.cxx +61 -24
- package/deps/couchbase-cxx-client/core/transactions/transactions_cleanup.cxx +36 -16
- package/deps/couchbase-cxx-client/core/transactions/utils.cxx +9 -0
- package/deps/couchbase-cxx-client/core/transactions.hxx +40 -7
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +19 -0
- package/deps/couchbase-cxx-client/couchbase/fork_event.hxx +39 -0
- package/dist/binding.d.ts +8 -0
- package/dist/bindingutilities.d.ts +6 -1
- package/dist/bindingutilities.js +15 -1
- package/dist/bucketmanager.d.ts +0 -12
- package/dist/cluster.d.ts +0 -2
- package/dist/cluster.js +0 -2
- package/dist/collection.d.ts +3 -3
- package/dist/collection.js +3 -1
- package/dist/querytypes.d.ts +0 -2
- package/dist/rangeScan.d.ts +0 -8
- package/dist/rangeScan.js +0 -8
- package/dist/scope.d.ts +0 -5
- package/dist/scope.js +0 -5
- package/dist/scopesearchindexmanager.d.ts +0 -2
- package/dist/scopesearchindexmanager.js +0 -2
- package/dist/searchexecutor.js +3 -1
- package/dist/searchtypes.d.ts +16 -6
- package/dist/searchtypes.js +2 -6
- package/dist/transactions.d.ts +23 -0
- package/dist/transactions.js +16 -10
- package/dist/vectorsearch.d.ts +8 -8
- package/dist/vectorsearch.js +7 -7
- package/package.json +7 -7
- package/src/instance.cpp +11 -1
- package/src/instance.hpp +1 -0
- package/src/jstocbpp_autogen.hpp +8 -0
- package/src/jstocbpp_transactions.hpp +40 -3
- package/src/transactions.cpp +12 -1
- package/tools/gen-bindings-json.py +0 -1
@@ -15,79 +15,80 @@
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
#include "attempt_context_testing_hooks.hxx"
|
18
|
+
#include "core/utils/movable_function.hxx"
|
18
19
|
|
19
20
|
namespace couchbase::core::transactions
|
20
21
|
{
|
21
22
|
namespace
|
22
23
|
{
|
23
|
-
inline
|
24
|
-
|
24
|
+
inline void
|
25
|
+
noop1(attempt_context*, utils::movable_function<void(std::optional<error_class>)>&& handler)
|
25
26
|
{
|
26
|
-
return {};
|
27
|
+
return handler({});
|
27
28
|
}
|
28
29
|
|
29
|
-
inline
|
30
|
-
|
30
|
+
inline void
|
31
|
+
noop2(attempt_context*, const std::string&, utils::movable_function<void(std::optional<error_class>)>&& handler)
|
31
32
|
{
|
32
|
-
return {};
|
33
|
+
return handler({});
|
33
34
|
}
|
34
35
|
|
35
36
|
inline std::optional<const std::string>
|
36
|
-
|
37
|
+
noop3(attempt_context*)
|
37
38
|
{
|
38
39
|
return {};
|
39
40
|
}
|
40
41
|
|
41
42
|
inline bool
|
42
|
-
|
43
|
+
noop4(attempt_context*, const std::string&, std::optional<const std::string>)
|
43
44
|
{
|
44
45
|
return false;
|
45
46
|
}
|
46
47
|
} // namespace
|
47
48
|
|
48
49
|
attempt_context_testing_hooks::attempt_context_testing_hooks()
|
49
|
-
: before_atr_commit{
|
50
|
-
, before_atr_commit_ambiguity_resolution{
|
51
|
-
, after_atr_commit{
|
52
|
-
, before_doc_committed{
|
53
|
-
, before_removing_doc_during_staged_insert{
|
54
|
-
, before_rollback_delete_inserted{
|
55
|
-
, after_doc_committed_before_saving_cas{
|
56
|
-
, after_doc_committed{
|
57
|
-
, before_staged_insert{
|
58
|
-
, before_staged_remove{
|
59
|
-
, before_staged_replace{
|
60
|
-
, before_doc_removed{
|
61
|
-
, before_doc_rolled_back{
|
62
|
-
, after_doc_removed_pre_retry{
|
63
|
-
, after_doc_removed_post_retry{
|
64
|
-
, after_get_complete{
|
65
|
-
, after_staged_replace_complete_before_cas_saved{
|
66
|
-
, after_staged_replace_complete{
|
67
|
-
, after_staged_remove_complete{
|
68
|
-
, after_staged_insert_complete{
|
69
|
-
, after_rollback_replace_or_remove{
|
70
|
-
, after_rollback_delete_inserted{
|
71
|
-
, before_check_atr_entry_for_blocking_doc{
|
72
|
-
, before_doc_get{
|
73
|
-
, before_get_doc_in_exists_during_staged_insert{
|
74
|
-
, before_query{
|
75
|
-
, after_query{
|
76
|
-
, before_remove_staged_insert{
|
77
|
-
, after_remove_staged_insert{
|
78
|
-
, after_docs_committed{
|
79
|
-
, after_docs_removed{
|
80
|
-
, after_atr_pending{
|
81
|
-
, before_atr_pending{
|
82
|
-
, before_atr_complete{
|
83
|
-
, before_atr_rolled_back{
|
84
|
-
, after_atr_complete{
|
85
|
-
, before_get_atr_for_abort{
|
86
|
-
, before_atr_aborted{
|
87
|
-
, after_atr_aborted{
|
88
|
-
, after_atr_rolled_back{
|
89
|
-
, random_atr_id_for_vbucket{
|
90
|
-
, has_expired_client_side{
|
50
|
+
: before_atr_commit{ noop1 }
|
51
|
+
, before_atr_commit_ambiguity_resolution{ noop1 }
|
52
|
+
, after_atr_commit{ noop1 }
|
53
|
+
, before_doc_committed{ noop2 }
|
54
|
+
, before_removing_doc_during_staged_insert{ noop2 }
|
55
|
+
, before_rollback_delete_inserted{ noop2 }
|
56
|
+
, after_doc_committed_before_saving_cas{ noop2 }
|
57
|
+
, after_doc_committed{ noop2 }
|
58
|
+
, before_staged_insert{ noop2 }
|
59
|
+
, before_staged_remove{ noop2 }
|
60
|
+
, before_staged_replace{ noop2 }
|
61
|
+
, before_doc_removed{ noop2 }
|
62
|
+
, before_doc_rolled_back{ noop2 }
|
63
|
+
, after_doc_removed_pre_retry{ noop2 }
|
64
|
+
, after_doc_removed_post_retry{ noop2 }
|
65
|
+
, after_get_complete{ noop2 }
|
66
|
+
, after_staged_replace_complete_before_cas_saved{ noop2 }
|
67
|
+
, after_staged_replace_complete{ noop2 }
|
68
|
+
, after_staged_remove_complete{ noop2 }
|
69
|
+
, after_staged_insert_complete{ noop2 }
|
70
|
+
, after_rollback_replace_or_remove{ noop2 }
|
71
|
+
, after_rollback_delete_inserted{ noop2 }
|
72
|
+
, before_check_atr_entry_for_blocking_doc{ noop2 }
|
73
|
+
, before_doc_get{ noop2 }
|
74
|
+
, before_get_doc_in_exists_during_staged_insert{ noop2 }
|
75
|
+
, before_query{ noop2 }
|
76
|
+
, after_query{ noop2 }
|
77
|
+
, before_remove_staged_insert{ noop2 }
|
78
|
+
, after_remove_staged_insert{ noop2 }
|
79
|
+
, after_docs_committed{ noop1 }
|
80
|
+
, after_docs_removed{ noop1 }
|
81
|
+
, after_atr_pending{ noop1 }
|
82
|
+
, before_atr_pending{ noop1 }
|
83
|
+
, before_atr_complete{ noop1 }
|
84
|
+
, before_atr_rolled_back{ noop1 }
|
85
|
+
, after_atr_complete{ noop1 }
|
86
|
+
, before_get_atr_for_abort{ noop1 }
|
87
|
+
, before_atr_aborted{ noop1 }
|
88
|
+
, after_atr_aborted{ noop1 }
|
89
|
+
, after_atr_rolled_back{ noop1 }
|
90
|
+
, random_atr_id_for_vbucket{ noop3 }
|
91
|
+
, has_expired_client_side{ noop4 }
|
91
92
|
{
|
92
93
|
}
|
93
94
|
} // namespace couchbase::core::transactions
|
@@ -16,6 +16,7 @@
|
|
16
16
|
#pragma once
|
17
17
|
|
18
18
|
#include "core/transactions/error_class.hxx"
|
19
|
+
#include "core/utils/movable_function.hxx"
|
19
20
|
|
20
21
|
#include <functional>
|
21
22
|
#include <optional>
|
@@ -25,8 +26,9 @@ namespace couchbase::core::transactions
|
|
25
26
|
{
|
26
27
|
class attempt_context;
|
27
28
|
|
28
|
-
using error_func1 = std::function<std::optional<error_class>
|
29
|
-
using error_func2 =
|
29
|
+
using error_func1 = std::function<void(attempt_context*, core::utils::movable_function<void(std::optional<error_class>)>&&)>;
|
30
|
+
using error_func2 =
|
31
|
+
std::function<void(attempt_context*, const std::string&, core::utils::movable_function<void(std::optional<error_class>)>&&)>;
|
30
32
|
|
31
33
|
static const std::string STAGE_ROLLBACK = "rollback";
|
32
34
|
static const std::string STAGE_GET = "get";
|
@@ -20,16 +20,16 @@ namespace couchbase::core::transactions
|
|
20
20
|
{
|
21
21
|
namespace
|
22
22
|
{
|
23
|
-
inline
|
24
|
-
noop1(const std::string
|
23
|
+
inline void
|
24
|
+
noop1(const std::string&, utils::movable_function<void(std::optional<error_class>)>&& handler)
|
25
25
|
{
|
26
|
-
return {};
|
26
|
+
return handler({});
|
27
27
|
}
|
28
28
|
|
29
|
-
inline
|
30
|
-
noop2()
|
29
|
+
inline void
|
30
|
+
noop2(utils::movable_function<void(std::optional<error_class>)>&& handler)
|
31
31
|
{
|
32
|
-
return {};
|
32
|
+
return handler({});
|
33
33
|
}
|
34
34
|
} // namespace
|
35
35
|
|
@@ -16,6 +16,7 @@
|
|
16
16
|
#pragma once
|
17
17
|
|
18
18
|
#include "core/transactions/error_class.hxx"
|
19
|
+
#include "core/utils/movable_function.hxx"
|
19
20
|
|
20
21
|
#include <functional>
|
21
22
|
#include <optional>
|
@@ -23,8 +24,8 @@
|
|
23
24
|
|
24
25
|
namespace couchbase::core::transactions
|
25
26
|
{
|
26
|
-
using error_func3 = std::function<std::optional<error_class>
|
27
|
-
using error_func4 = std::function<std::optional<error_class>
|
27
|
+
using error_func3 = std::function<void(const std::string&, core::utils::movable_function<void(std::optional<error_class>)>&&)>;
|
28
|
+
using error_func4 = std::function<void(core::utils::movable_function<void(std::optional<error_class>)>&&)>;
|
28
29
|
|
29
30
|
/**
|
30
31
|
* Hooks purely for testing purposes. If you're an end-user looking at these for any reason, then please contact us first
|
@@ -127,6 +127,8 @@ class transactions_cleanup
|
|
127
127
|
const atr_cleanup_stats force_cleanup_atr(const core::document_id& atr_id, std::vector<transactions_cleanup_attempt>& results);
|
128
128
|
const client_record_details get_active_clients(const couchbase::transactions::transaction_keyspace& keyspace, const std::string& uuid);
|
129
129
|
void remove_client_record_from_all_buckets(const std::string& uuid);
|
130
|
+
void start();
|
131
|
+
void stop();
|
130
132
|
void close();
|
131
133
|
|
132
134
|
private:
|
@@ -26,6 +26,7 @@
|
|
26
26
|
#include <functional>
|
27
27
|
#include <future>
|
28
28
|
#include <limits>
|
29
|
+
#include <optional>
|
29
30
|
#include <random>
|
30
31
|
#include <string>
|
31
32
|
#include <thread>
|
@@ -79,6 +80,9 @@ validate_operation_result(result& res, bool ignore_subdoc_errors = true);
|
|
79
80
|
result
|
80
81
|
wrap_operation_future(std::future<result>& fut, bool ignore_subdoc_errors = true);
|
81
82
|
|
83
|
+
std::optional<error_class>
|
84
|
+
wait_for_hook(std::function<void(utils::movable_function<void(std::optional<error_class>)>)> hook);
|
85
|
+
|
82
86
|
inline void
|
83
87
|
wrap_collection_call(result& res, std::function<void(result&)> call);
|
84
88
|
|
@@ -326,7 +330,7 @@ struct async_exp_delay {
|
|
326
330
|
|
327
331
|
void operator()(utils::movable_function<void(std::exception_ptr)> callback) const
|
328
332
|
{
|
329
|
-
if (retries >= max_retries) {
|
333
|
+
if (retries++ >= max_retries) {
|
330
334
|
callback(std::make_exception_ptr(retry_operation_retries_exhausted("retries exhausted")));
|
331
335
|
return;
|
332
336
|
}
|