From 334c154b11ba1338071390f04db993773523a0d3 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Thu, 7 Mar 2024 09:50:50 +0000 Subject: [PATCH 1/2] Remove client-side spec-size enforcing --- core/impl/collection.cxx | 3 --- core/operations/document_lookup_in_any_replica.hxx | 3 --- 2 files changed, 6 deletions(-) diff --git a/core/impl/collection.cxx b/core/impl/collection.cxx index 743696a8..50f8bba1 100644 --- a/core/impl/collection.cxx +++ b/core/impl/collection.cxx @@ -621,9 +621,6 @@ class collection_impl : public std::enable_shared_from_this if (!config.capabilities.supports_subdoc_read_replica()) { ec = errc::common::feature_not_available; } - if (r->specs().size() > 16) { - ec = errc::common::invalid_argument; - } if (ec) { return h(core::make_subdocument_error_context(make_key_value_error_context(ec, r->id()), ec, {}, {}, false), lookup_in_replica_result{}); diff --git a/core/operations/document_lookup_in_any_replica.hxx b/core/operations/document_lookup_in_any_replica.hxx index 170b0d7b..df8609f5 100644 --- a/core/operations/document_lookup_in_any_replica.hxx +++ b/core/operations/document_lookup_in_any_replica.hxx @@ -79,9 +79,6 @@ struct lookup_in_any_replica_request { if (!config.capabilities.supports_subdoc_read_replica()) { ec = errc::common::feature_not_available; } - if (specs.size() > 16) { - ec = errc::common::invalid_argument; - } if (ec) { std::optional first_error_path{}; From 98830b3c7814e59f0efd474d3fc8e411c692ffa0 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Thu, 7 Mar 2024 10:45:01 +0000 Subject: [PATCH 2/2] update test --- test/test_integration_subdoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_integration_subdoc.cxx b/test/test_integration_subdoc.cxx index 9819c4fe..1a9c8a2d 100644 --- a/test/test_integration_subdoc.cxx +++ b/test/test_integration_subdoc.cxx @@ -1548,7 +1548,7 @@ TEST_CASE("integration: subdoc any replica reads", "[integration]") req.specs = specs.specs(); auto resp = test::utils::execute(integration.cluster, req); - REQUIRE(resp.ctx.ec() == couchbase::errc::common::invalid_argument); + REQUIRE(resp.ctx.ec() == couchbase::errc::key_value::document_irretrievable); REQUIRE(resp.fields.empty()); } @@ -1588,7 +1588,7 @@ TEST_CASE("integration: subdoc any replica reads", "[integration]") specs.push_back(couchbase::lookup_in_specs::get("dictkey")); } auto [ctx, result] = collection.lookup_in_any_replica(key, specs).get(); - REQUIRE(ctx.ec() == couchbase::errc::common::invalid_argument); + REQUIRE(ctx.ec() == couchbase::errc::key_value::document_irretrievable); REQUIRE(result.cas().empty()); }