-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colocation: cache db colocated in postgres (#4101)
Summary: In an effort to bring awareness of colocation to the postgres backend, cache whether the database is colocated upon connecting to it, as suggested by Neha. Add postgres global variable `MyDatabaseColocated` to cache the value; add protobufs `GetNamespaceInfoRequestPB` and `GetNamespaceInfoResponsePB` with master service RPC `GetNamespaceInfo` to retrieve whether the database is colocated from master; add various functions which are checked in the following call tree. * [ ] InitPostgres * [x] YBCPgIsDatabaseColocated * [x] PgApiImpl::IsDatabaseColocated * [x] PgSession::IsDatabaseColocated * [x] YBClient::GetNamespaceInfo * [x] YBClient::Data::SyncLeaderMasterRpc<GetNamespaceInfo...> * ... * [x] MasterServiceImpl::GetNamespaceInfo * [x] CatalogManager::GetNamespaceInfo Close: #4101 Test Plan: * Manual test for `postgres`'s `MyDatabaseColocated` variable: 1. Connect to a non-colocated database (e.g. `./bin/ysqlsh -c yugabyte`) 1. `gdb -p <pid_of_that_postgres_process>` 1. `print MyDatabaseColocated` (within GDB) should be `false` 1. `quit` (within GDB) 1. Create and connect to a colocated database (e.g. `CREATE DATABASE co COLOCATED true`, `\c co`) 1. `gdb -p <pid_of_that_postgres_process>` (should be different) 1. `print MyDatabaseColocated` (within GDB) should be `true` * `./yb_build.sh --cxx-test client_client-test --gtest_filter ClientTest.GetNamespaceInfo` Reviewers: mihnea, neha Reviewed By: neha Subscribers: yql, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D8207
- Loading branch information
Jason Kim
committed
Apr 1, 2020
1 parent
4b24697
commit f008209
Showing
20 changed files
with
158 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters