mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
main, scylla-gdb, cql-test-env: Unify debug::the_database
All the debug:: inhabitants have their names look like "the_<classname>" This patch brings the database piece to this standard. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
2
debug.hh
2
debug.hh
@@ -27,7 +27,7 @@ class database;
|
||||
|
||||
namespace debug {
|
||||
|
||||
extern seastar::sharded<database>* db;
|
||||
extern seastar::sharded<database>* the_database;
|
||||
|
||||
|
||||
}
|
||||
|
||||
9
main.cc
9
main.cc
@@ -409,6 +409,7 @@ sharded<cql3::query_processor>* the_query_processor;
|
||||
sharded<qos::service_level_controller>* the_sl_controller;
|
||||
sharded<service::migration_manager>* the_migration_manager;
|
||||
sharded<service::storage_service>* the_storage_service;
|
||||
sharded<database>* the_database;
|
||||
}
|
||||
|
||||
int main(int ac, char** av) {
|
||||
@@ -485,7 +486,6 @@ int main(int ac, char** av) {
|
||||
distributed<database> db;
|
||||
seastar::sharded<service::cache_hitrate_calculator> cf_cache_hitrate_calculator;
|
||||
service::load_meter load_meter;
|
||||
debug::db = &db;
|
||||
auto& proxy = service::get_storage_proxy();
|
||||
sharded<service::storage_service> ss;
|
||||
sharded<service::migration_manager> mm;
|
||||
@@ -867,6 +867,7 @@ int main(int ac, char** av) {
|
||||
// service_memory_limiter.stop().get();
|
||||
});
|
||||
|
||||
debug::the_database = &db;
|
||||
db.start(std::ref(*cfg), dbcfg, std::ref(mm_notifier), std::ref(feature_service), std::ref(token_metadata), std::ref(stop_signal.as_sharded_abort_source()), std::ref(sst_dir_semaphore)).get();
|
||||
start_large_data_handler(db).get();
|
||||
auto stop_database_and_sstables = defer_verbose_shutdown("database", [&db] {
|
||||
@@ -1456,9 +1457,3 @@ int main(int ac, char** av) {
|
||||
return 7; // 1 has a special meaning for upstart
|
||||
}
|
||||
}
|
||||
|
||||
namespace debug {
|
||||
|
||||
seastar::sharded<database>* db;
|
||||
|
||||
}
|
||||
|
||||
@@ -983,7 +983,12 @@ class sharded:
|
||||
|
||||
|
||||
def find_db(shard=None):
|
||||
return sharded(gdb.parse_and_eval('::debug::db')).instance(shard)
|
||||
try:
|
||||
db = gdb.parse_and_eval('::debug::the_database')
|
||||
except Exception as e:
|
||||
db = gdb.parse_and_eval('::debug::db')
|
||||
|
||||
return sharded(db).instance(shard)
|
||||
|
||||
|
||||
def find_dbs():
|
||||
|
||||
@@ -464,9 +464,9 @@ public:
|
||||
abort_sources.start().get();
|
||||
auto stop_abort_sources = defer([&] { abort_sources.stop().get(); });
|
||||
sharded<database> db;
|
||||
debug::db = &db;
|
||||
debug::the_database = &db;
|
||||
auto reset_db_ptr = defer([] {
|
||||
debug::db = nullptr;
|
||||
debug::the_database = nullptr;
|
||||
});
|
||||
auto cfg = cfg_in.db_config;
|
||||
tmpdir data_dir;
|
||||
@@ -827,6 +827,6 @@ cql_test_config raft_cql_test_config() {
|
||||
|
||||
namespace debug {
|
||||
|
||||
seastar::sharded<database>* db;
|
||||
seastar::sharded<database>* the_database;
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ do('break sstables::compact_sstables')
|
||||
do('ignore 1 10')
|
||||
do('run')
|
||||
|
||||
db = sharded(gdb.parse_and_eval('::debug::db')).local()
|
||||
db = sharded(gdb.parse_and_eval('::debug::the_database')).local()
|
||||
gdb.set_convenience_variable('db', db)
|
||||
|
||||
# now try some commands
|
||||
|
||||
Reference in New Issue
Block a user