[MCOL-4869] Add a more verbose error message for "unable to open Buffered file " Created: 2021-09-17  Updated: 2023-12-15

Status: Open
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: Icebox

Type: New Feature Priority: Major
Reporter: Richard Stracke Assignee: Max Mether
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Hello,

Example error message:

D 35 CAL0002: Failed to open file: /var/lib/columnstore/data1/systemFiles/dbrm/SMTxnID, exception: unable to open Buffered file 

Code path /utils/ibdatafile/BufferedFile.cpp

BufferedFile::BufferedFile(const char* fname, const char* mode, unsigned opts) :
    IDBDataFile( fname ),
    m_fp( 0 ),
    m_buffer( 0 )
{
    m_fp = fopen(fname, mode);
 
    if ( m_fp == NULL )
    {
        throw std::runtime_error("unable to open Buffered file ");
    }

If it returns NULL, errno will be set, which gave information about the reason,
why fopen() failed. ( if ( errno != 0 ) )

Addings the errno would be helpful, what is going on.

Upon successful completion, fopen() shall return a pointer to the object controlling the stream. Otherwise, a null pointer shall be returned, [CX] [Option Start]  and errno shall be set to indicate the error. 

https://pubs.opengroup.org/onlinepubs/007904975/functions/fopen.html


Generated at Thu Feb 08 02:53:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.