You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
fix(cmapi, brm): MCOL-5535 Use an accurate glob when forcing owner of files in /dev/shm on startup (#2923)
Co-authored-by: Roman Nozdrin <rnozdrin@mariadb.com>
This commit is contained in:
@ -375,6 +375,8 @@ IF(NOT TARGET columnstore)
|
|||||||
RETURN()
|
RETURN()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
SET (SHMEM_FILE_GLOB "MCS-shm-")
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(utils)
|
ADD_SUBDIRECTORY(utils)
|
||||||
ADD_SUBDIRECTORY(oam/oamcpp)
|
ADD_SUBDIRECTORY(oam/oamcpp)
|
||||||
ADD_SUBDIRECTORY(dbcon/execplan)
|
ADD_SUBDIRECTORY(dbcon/execplan)
|
||||||
|
@ -440,7 +440,7 @@ if __name__ == '__main__':
|
|||||||
# There were cases when shmem segments belongs to root so
|
# There were cases when shmem segments belongs to root so
|
||||||
# explicitly chowns segments.
|
# explicitly chowns segments.
|
||||||
if use_systemd:
|
if use_systemd:
|
||||||
for shm_file in glob.glob('/dev/shm/*'):
|
for shm_file in glob.glob('/dev/shm/@SHMEM_FILE_GLOB@*'):
|
||||||
shutil.chown(shm_file, USER, GROUP)
|
shutil.chown(shm_file, USER, GROUP)
|
||||||
except subprocess.CalledProcessError as exc:
|
except subprocess.CalledProcessError as exc:
|
||||||
logging.error('{} exits with {}.'.format(cmd, exc.returncode))
|
logging.error('{} exits with {}.'.format(cmd, exc.returncode))
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||||
|
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shmkeys.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/shmkeys.cpp" @ONLY)
|
||||||
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/brmshmimpl.h.in" "${CMAKE_CURRENT_SOURCE_DIR}/brmshmimpl.h" @ONLY)
|
||||||
|
|
||||||
|
|
||||||
########### next target ###############
|
########### next target ###############
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
//#define NDEBUG
|
// #define NDEBUG
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <boost/interprocess/shared_memory_object.hpp>
|
#include <boost/interprocess/shared_memory_object.hpp>
|
||||||
#include <boost/interprocess/managed_shared_memory.hpp>
|
#include <boost/interprocess/managed_shared_memory.hpp>
|
||||||
@ -131,7 +131,7 @@ class BRMManagedShmImplRBTree : public BRMShmImplParent
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// The `segment` name is fixed.
|
// The `segment` name is fixed.
|
||||||
const char* segmentName = "MCS-shm-00020001";
|
const char* segmentName = "@SHMEM_FILE_GLOB@00020001";
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace BRM
|
} // namespace BRM
|
@ -63,7 +63,7 @@ ShmKeys::ShmKeys()
|
|||||||
string ShmKeys::keyToName(unsigned key)
|
string ShmKeys::keyToName(unsigned key)
|
||||||
{
|
{
|
||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
oss << "MCS-shm-";
|
oss << "@SHMEM_FILE_GLOB@";
|
||||||
oss << setw(8) << setfill('0') << hex << key;
|
oss << setw(8) << setfill('0') << hex << key;
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
Reference in New Issue
Block a user