From 1129008a930ca6c25ceaad7d404fb94f8d026171 Mon Sep 17 00:00:00 2001 From: Ypatia Tsavliri Date: Tue, 14 May 2024 12:33:56 +0300 Subject: [PATCH] Restore rest.resubmit_incomplete config parameter (#4970) For some inexplicable reason I thought `rest.resubmit_incomplete` config variable wasn't used anymore and removed it in https://github.com/TileDB-Inc/TileDB/pull/3879 . This PR is for reverting this change. --- TYPE: IMPROVEMENT DESC: Restore rest.resubmit_incomplete config parameter --- test/src/unit-capi-rest-dense_array.cc | 7 ++++++- tiledb/api/c_api/config/config_api_external.h | 4 ++++ tiledb/sm/cpp_api/config.h | 4 ++++ tiledb/sm/rest/rest_client.cc | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/test/src/unit-capi-rest-dense_array.cc b/test/src/unit-capi-rest-dense_array.cc index 3f9d4a29012..cd4cff6328b 100644 --- a/test/src/unit-capi-rest-dense_array.cc +++ b/test/src/unit-capi-rest-dense_array.cc @@ -1699,7 +1699,12 @@ TEST_CASE_METHOD( DenseArrayRESTFx, "C API: REST Test dense array, incomplete reads", "[capi][rest][dense][incomplete]") { - // TODO: refactor for each supported FS. + tiledb_error_t* error; + tiledb_config_t* config; + tiledb_config_alloc(&config, &error); + REQUIRE( + tiledb_config_set(config, "rest.resubmit_incomplete", "false", &error) == + TILEDB_OK); check_incomplete_reads(); } diff --git a/tiledb/api/c_api/config/config_api_external.h b/tiledb/api/c_api/config/config_api_external.h index 0b62b147ef0..8be1968935c 100644 --- a/tiledb/api/c_api/config/config_api_external.h +++ b/tiledb/api/c_api/config/config_api_external.h @@ -623,6 +623,10 @@ TILEDB_EXPORT void tiledb_config_free(tiledb_config_t** config) TILEDB_NOEXCEPT; * Authentication token for REST server (used instead of * username/password).
* **Default**: "" + * - `rest.resubmit_incomplete`
+ * If true, incomplete queries received from server are automatically + * resubmitted before returning to user control.
+ * **Default**: "true" * - `rest.ignore_ssl_validation`
* Have curl ignore ssl peer and host validation for REST server.
* **Default**: false diff --git a/tiledb/sm/cpp_api/config.h b/tiledb/sm/cpp_api/config.h index 74aee2a827b..e2cd3bc727b 100644 --- a/tiledb/sm/cpp_api/config.h +++ b/tiledb/sm/cpp_api/config.h @@ -801,6 +801,10 @@ class Config { * Authentication token for REST server (used instead of * username/password).
* **Default**: "" + * - `rest.resubmit_incomplete`
+ * If true, incomplete queries received from server are automatically + * resubmitted before returning to user control.
+ * **Default**: "true" * - `rest.ignore_ssl_validation`
* Have curl ignore ssl peer and host validation for REST server.
* **Default**: false diff --git a/tiledb/sm/rest/rest_client.cc b/tiledb/sm/rest/rest_client.cc index 1429b36b3da..c06aa2cfa3b 100644 --- a/tiledb/sm/rest/rest_client.cc +++ b/tiledb/sm/rest/rest_client.cc @@ -144,6 +144,10 @@ Status RestClient::init( if (c_str != nullptr) RETURN_NOT_OK(serialization_type_enum(c_str, &serialization_type_)); + bool found = false; + RETURN_NOT_OK(config_->get( + "rest.resubmit_incomplete", &resubmit_incomplete_, &found)); + return Status::Ok(); }