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
[DocDB] Use async callback mechanism in YBMetaDataCache::GetTable #17038
Comments
Summary: It could happen that opening table during index update blocks too many threads, resulting in deadlock. Introduce GetTableAsync in YBMetaDataCache and use while updating indexes. Test Plan: Jenkins Reviewers: stiwary Reviewed By: stiwary Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D25887
Summary: Make the MetaDataCache::GetTable logic completely async by introducing an async OpenTable in YBClient. Presently, the first thread blocks while other threads register a callback. Post this diff, the first thread will also not block. Jira: DB-6349 Test Plan: Jenkins Reviewers: sergei, bogdan, skumar Reviewed By: sergei Differential Revision: https://phorge.dev.yugabyte.com/D26081
Summary: As part of https://phorge.dev.yugabyte.com/D26081, we made the OpenTable async. An issue broke the fastdebug gcc11 build. The `info` shared_ptr was being captured via `std::move` and the `info->table_id` was passed as a const reference inside `FetchPartitions` leading to SIGSEGV Also, while converting from the sync to the async version of `GetTableSchema`, I missed that we also have to handle the status sent in the callback & not just in the functions return value. Fixed them both & tested on dev server. Jira: DB-6349 Test Plan: Jenkins: urgent `./yb_build.sh fastdebug --gcc11 --cxx-test pgwrapper_create_initial_sys_catalog_snapshot --gtest_filter CreateInitialSysCatalogSnapshotTest.CreateInitialSysCatalogSnapshot` Other Jenkins tests Reviewers: sergei Reviewed By: sergei Differential Revision: https://phorge.dev.yugabyte.com/D26209
Summary: It could happen that opening table during index update blocks too many threads, resulting in deadlock. Introduce GetTableAsync in YBMetaDataCache and use while updating indexes. Original commit: 099a148/D25887 Jira: DB-6349 Test Plan: Jenkins Reviewers: stiwary, bogdan Reviewed By: bogdan Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D26385
Summary: It could happen that opening table during index update blocks too many threads, resulting in deadlock. Introduce GetTableAsync in YBMetaDataCache and use while updating indexes. Original commit: 099a148/D25887 Test Plan: Jenkins Reviewers: stiwary, bogdan Reviewed By: bogdan Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D26387
Summary: It could happen that opening table during index update blocks too many threads, resulting in deadlock. Introduce GetTableAsync in YBMetaDataCache and use while updating indexes. Original commit: 099a148/D25887 Jira: DB-6349 Test Plan: Jenkins Reviewers: stiwary, bogdan Reviewed By: stiwary Subscribers: ybase Differential Revision: https://phorge.dev.yugabyte.com/D26429
Note that we didn't backport the async OpenTable of YBClient. That is okay because it was a minor piece. The main fix was to make The async OpenTable of YBClient ensures that even the first thread doesn't get blocked. So it is ok to not backport it. |
Jira Link: DB-6349
Description
For #16697, as a short term solution, we will protect multiple calls to
OpenTable
through a barrier approach.For long term, it should be made non-blocking.
This will be slightly more involving.
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: