Seeking help with analysis of OpenGauss 6.0 database crashes and LLVM failures

Hello, I have a single-machine deployment of openGauss 6.0.0 database, and during operation, it experienced an abnormal crash (process termination), generating a core file. After analyzing the call stack with gdb, the crash occurred inside the LLVM compiler. I am seeking help.

Environment Information:

  • Database Version: (openGauss 6.0.0 build aee4abd5) compiled at 2024-09-29 19:14:27 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 10.3.0, 64-bit

  • Operating System: openEuler 24.03 (LTS-SP4)

  • Deployment Mode: Single-machine edition

  • Parameter Status: Executing SHOW enable_codegen; returns off; attempting to query SHOW enable_codegen_mot; results in unrecognized configuration parameter.

Fault Phenomenon and Log Clues:

  1. Before the crash: The postgresql logs repeatedly show unique constraint conflicts for the pg_statistic system table (duplicate key value violates unique constraint "pg_statistic_relid_kind_att_inh_index"), primarily during the autovacuum process on the anpm.monitor_process table.

  2. At the time of the crash: A core file was generated. Using the official 6.0.0 symbol table with gdb, multiple thread call stacks were found to include llvm::runIPSCCP(...); for example:

    text

    Thread 5 (LWP 1739368):
    #8  0x0000000002fe3c40 in llvm::runIPSCCP(llvm::Module&, llvm::DataLayout const&, std::function<llvm::TargetLibraryInfo const& (llvm::Function&)>, llvm::function_ref<llvm::AnalysisResultsForFn (llvm::Function&)>) ()
    

My Questions and Request for Help:

  1. According to public information, enable_codegen is already disabled, but why does the process still enter the LLVM compilation path (runIPSCCP)? Is it because internal logic related to MOT triggered LLVM, but the enable_codegen_mot parameter is missing in the current version, making it impossible to disable it through parameters?

  2. In the openGauss 6.0.0 version, has there been a clear fix patch for this type of low-level crash caused by malformed IR in LLVM runIPSCCP?

  3. If upgrading to openGauss 6.0.3 or a newer patch version, would it include a fix for this issue, or have it resolved the problem of missing MOT switch parameters such as enable_codegen_mot?

  4. Besides fixing pg_statistic and disabling related parameters, are there other methods in the current version to completely avoid the risk of downtime caused by this LLVM defect?

SHOW enable_codegen_mot shows the unrecognized configuration parameter because the distribution does not compile mot

Seen a similar fix: https://gitcode.com/opengauss/openGauss-server/pull/8701

Try upgrading to 6.0.6 or 7.0.0.