futurewei-cloud / chogori-opengauss

Other
2 stars 7 forks source link

PgGate_InitPgGate is not called during opengauss boot #45

Open ahsank opened 1 year ago

ahsank commented 1 year ago

Currently PgGate_InitPgGate is only called in PostressMain. However PostressMain is not called in boot sequence. Instead, BootStrapProcessMain function is called during boot sequence https://github.com/futurewei-cloud/chogori-opengauss/blob/mainline/src/gausskernel/process/main/main.cpp#L277. The code K2PgInitPostgresBackend should also be called from BootStrapProcessMain.

Otherwise`` the code later finds that k2pg not initialized and returns error

#0  PgGate_IsK2PgEnabled () at pg_gate_api.cpp:764
#1  0x0000555556adecb5 in IsK2PgEnabled () at k2pg_aux.cpp:31
#2  0x000055555622a0bf in RelationCacheInitializePhase3 () at relcache.cpp:4919
#3  0x000055555627390a in PostgresInitializer::LoadSysCache (this=0x7fffdefe4760) at postinit.cpp:2419
#4  PostgresInitializer::InitBootstrap (this=0x7fffdefe4760) at postinit.cpp:1165
#5  0x0000555556326c9c in BootstrapModeMain () at bootstrap.cpp:403
#6  BootStrapProcessMain (argc=<optimized out>, argv=0x7fffde8b1b30) at bootstrap.cpp:361
#7  0x0000555555da245f in main (argc=4, argv=0x7fffde8b1b28) at main.cpp:284