Skip to content

fix: serve() should not drop LOADed extensions (prefer createCheckpoint over Close/Open) #750

Description

@liulx20

Summary

Calling Database.serve() after LOAD <extension> makes previously loaded extensions unusable. Install files on disk remain, but Catalog/VFS registrations are gone.

Root cause

PyDatabase::serve() currently does:

database->Close();
database->Open(database->config());

Close() resets planner_, which (today) owns MetadataManager / Catalog. Open() constructs a new empty GOptPlanner, so extension functions registered by LOAD disappear.

createCheckpoint() itself does not clear MetadataManager; the loss comes from tearing down the planner during Close/Open.

Why this is wrong

serve() only needs to persist AP-mode changes before switching to TP service. That intent matches createCheckpoint(true) (compact + dump + reopen graph in place), which should keep planner / Catalog / LOADed extensions intact.

NeugDBService::init already requires the DB to be open and reuses GetPlanner() / GetQueryCache().

Proposed direction

  1. Change serve() to roughly:
    • CloseAllConnection() (local AP connections must be closed)
    • createCheckpoint(true) (persist + refresh graph)
    • start NeugDBService
  2. Avoid Close() + Open() on the serve path unless something TP-specific still requires a full reopen.
  3. Optionally keep MetadataManager lifetime on NeugDB as a safety net for any remaining Close/Open cycles.

Metadata

Metadata

Assignees

Labels

extensionExtension systemstoreStorage layertransactionTransaction management

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions