-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix schema timestamps used when loading enumerations from REST. #5291
Conversation
+ Fix error by using current schema's timestamps when loading enumerations from REST.
/** Handle `struct` for API ArraySchema objects. */ | ||
struct tiledb_array_schema_handle_t | ||
: public tiledb::api::CAPIHandle<tiledb_array_schema_handle_t> { | ||
/** Type name */ | ||
static constexpr std::string_view object_type_name{"array_schema"}; | ||
|
||
private: | ||
using array_schema_type = shared_ptr<ArraySchema>; | ||
using array_schema_type = shared_ptr<tiledb::sm::ArraySchema>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why we now need to fully qualify tiledb::sm classes now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, meant to add a comment for this on my PR. It was namespace pollution with using tiledb::sm
at the top of this file. When I included this header it makes tiledb::Array
and tiledb::sm::Array
ambiguous for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once Luc's comment is addressed. Thanks for the quick fix!
/backport to release-2.26 |
Started backporting to release-2.26: https://github.com/TileDB-Inc/TileDB/actions/runs/10773738557 |
@KiterLuc backporting to release-2.26 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Add REST test.
Using index info to reconstruct a base tree...
A tiledb/api/c_api/array_schema/array_schema_api.cc
A tiledb/api/c_api/array_schema/array_schema_api_internal.h
M tiledb/sm/array/array.cc
Falling back to patching base and 3-way merge...
Auto-merging tiledb/sm/array/array.cc
CONFLICT (modify/delete): tiledb/api/c_api/array_schema/array_schema_api_internal.h deleted in HEAD and modified in Add REST test.. Version Add REST test. of tiledb/api/c_api/array_schema/array_schema_api_internal.h left in tree.
CONFLICT (modify/delete): tiledb/api/c_api/array_schema/array_schema_api.cc deleted in HEAD and modified in Add REST test.. Version Add REST test. of tiledb/api/c_api/array_schema/array_schema_api.cc left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Add REST test.
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@KiterLuc an error occurred while backporting to release-2.26, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
…rations from REST. (#5291) (#5293) Backport of #5291 to release-2.26. --- TYPE: NO_HISTORY DESC: Fix schema timestamps used when loading enumerations from REST. --------- Co-authored-by: Ypatia Tsavliri <[email protected]>
This fixes a performance regression added in #5291 while loading enumerations for all array schemas. The regression impacts arrays with multiple evolved schemas. Previously #5291 introduced a loop over REST requests for-each schema, this PR loads all enumerations for all schemas in a single request. --- TYPE: C_API DESC: Introduce tiledb_array_load_enumerations_all_schemas TYPE: CPP_API DESC: Introduce ArrayExperimental::load_enumerations_all_schemas --------- Co-authored-by: Ypatia Tsavliri <[email protected]>
This fixes a bug loading enumerations after a REST request was made using array directory timestamp ranges. The response from the request gives the enumerations on the latest schema in that range, which can result in attempting to store enumerations on a schema where they no longer exist after being dropped in a previous array schema evolution.
Thanks @johnkerl for reporting, in the end I found the exact error from your issue was thrown because the enumeration happened to have the same name as a previously dropped enumeration. I was able to reproduce your error in the test case I added here by evolving the schema a third time to add back an enumeration with an identical name of one that was previously dropped.
TYPE: NO_HISTORY
DESC: Fix schema timestamps used when loading enumerations from REST.