mirror of https://github.com/citusdata/citus.git
Add adapter functions for OpenFile changes
parent
d686123dae
commit
b4d53423fa
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include "distributed/relay_utility.h"
|
#include "distributed/relay_utility.h"
|
||||||
#include "distributed/transmit.h"
|
#include "distributed/transmit.h"
|
||||||
|
#include "distributed/version_compat.h"
|
||||||
#include "libpq/libpq.h"
|
#include "libpq/libpq.h"
|
||||||
#include "libpq/pqformat.h"
|
#include "libpq/pqformat.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
|
@ -166,7 +167,7 @@ FileOpenForTransmit(const char *filename, int fileFlags, int fileMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fileDesc = PathNameOpenFile((char *) filename, fileFlags, fileMode);
|
fileDesc = PathNameOpenFilePerm((char *) filename, fileFlags, fileMode);
|
||||||
if (fileDesc < 0)
|
if (fileDesc < 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode_for_file_access(),
|
ereport(ERROR, (errcode_for_file_access(),
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "distributed/multi_physical_planner.h"
|
#include "distributed/multi_physical_planner.h"
|
||||||
#include "distributed/multi_server_executor.h"
|
#include "distributed/multi_server_executor.h"
|
||||||
#include "distributed/worker_protocol.h"
|
#include "distributed/worker_protocol.h"
|
||||||
|
#include "distributed/version_compat.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
#include "utils/timestamp.h"
|
#include "utils/timestamp.h"
|
||||||
|
|
||||||
|
@ -521,7 +522,7 @@ ManageTaskExecution(Task *task, TaskExecution *taskExecution,
|
||||||
int fileFlags = (O_APPEND | O_CREAT | O_RDWR | O_TRUNC | PG_BINARY);
|
int fileFlags = (O_APPEND | O_CREAT | O_RDWR | O_TRUNC | PG_BINARY);
|
||||||
int fileMode = (S_IRUSR | S_IWUSR);
|
int fileMode = (S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
int32 fileDescriptor = BasicOpenFile(filename, fileFlags, fileMode);
|
int32 fileDescriptor = BasicOpenFilePerm(filename, fileFlags, fileMode);
|
||||||
if (fileDescriptor >= 0)
|
if (fileDescriptor >= 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "distributed/multi_server_executor.h"
|
#include "distributed/multi_server_executor.h"
|
||||||
#include "distributed/pg_dist_partition.h"
|
#include "distributed/pg_dist_partition.h"
|
||||||
#include "distributed/worker_protocol.h"
|
#include "distributed/worker_protocol.h"
|
||||||
|
#include "distributed/version_compat.h"
|
||||||
#include "storage/fd.h"
|
#include "storage/fd.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "utils/hsearch.h"
|
#include "utils/hsearch.h"
|
||||||
|
@ -1340,7 +1341,7 @@ ManageTransmitExecution(TaskTracker *transmitTracker,
|
||||||
int fileFlags = (O_APPEND | O_CREAT | O_RDWR | O_TRUNC | PG_BINARY);
|
int fileFlags = (O_APPEND | O_CREAT | O_RDWR | O_TRUNC | PG_BINARY);
|
||||||
int fileMode = (S_IRUSR | S_IWUSR);
|
int fileMode = (S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
int32 fileDescriptor = BasicOpenFile(filename, fileFlags, fileMode);
|
int32 fileDescriptor = BasicOpenFilePerm(filename, fileFlags, fileMode);
|
||||||
if (fileDescriptor >= 0)
|
if (fileDescriptor >= 0)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "distributed/resource_lock.h"
|
#include "distributed/resource_lock.h"
|
||||||
#include "distributed/task_tracker.h"
|
#include "distributed/task_tracker.h"
|
||||||
#include "distributed/worker_protocol.h"
|
#include "distributed/worker_protocol.h"
|
||||||
|
#include "distributed/version_compat.h"
|
||||||
#include "nodes/makefuncs.h"
|
#include "nodes/makefuncs.h"
|
||||||
#include "storage/lmgr.h"
|
#include "storage/lmgr.h"
|
||||||
#include "tcop/tcopprot.h"
|
#include "tcop/tcopprot.h"
|
||||||
|
@ -263,7 +264,7 @@ ReceiveRegularFile(const char *nodeName, uint32 nodePort,
|
||||||
/* create local file to append remote data to */
|
/* create local file to append remote data to */
|
||||||
snprintf(filename, MAXPGPATH, "%s", filePath->data);
|
snprintf(filename, MAXPGPATH, "%s", filePath->data);
|
||||||
|
|
||||||
fileDescriptor = BasicOpenFile(filename, fileFlags, fileMode);
|
fileDescriptor = BasicOpenFilePerm(filename, fileFlags, fileMode);
|
||||||
if (fileDescriptor < 0)
|
if (fileDescriptor < 0)
|
||||||
{
|
{
|
||||||
ereport(WARNING, (errcode_for_file_access(),
|
ereport(WARNING, (errcode_for_file_access(),
|
||||||
|
|
|
@ -410,7 +410,7 @@ OpenPartitionFiles(StringInfo directoryName, uint32 fileCount)
|
||||||
{
|
{
|
||||||
StringInfo filePath = PartitionFilename(directoryName, fileIndex);
|
StringInfo filePath = PartitionFilename(directoryName, fileIndex);
|
||||||
|
|
||||||
fileDescriptor = PathNameOpenFile(filePath->data, fileFlags, fileMode);
|
fileDescriptor = PathNameOpenFilePerm(filePath->data, fileFlags, fileMode);
|
||||||
if (fileDescriptor < 0)
|
if (fileDescriptor < 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode_for_file_access(),
|
ereport(ERROR, (errcode_for_file_access(),
|
||||||
|
|
|
@ -24,10 +24,26 @@
|
||||||
#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 110000)
|
#if (PG_VERSION_NUM >= 90600 && PG_VERSION_NUM < 110000)
|
||||||
|
|
||||||
#include "access/hash.h"
|
#include "access/hash.h"
|
||||||
|
#include "storage/fd.h"
|
||||||
|
|
||||||
/* PostgreSQL 11 splits hash procs into "standard" and "extended" */
|
/* PostgreSQL 11 splits hash procs into "standard" and "extended" */
|
||||||
#define HASHSTANDARD_PROC HASHPROC
|
#define HASHSTANDARD_PROC HASHPROC
|
||||||
|
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
BasicOpenFilePerm(FileName fileName, int fileFlags, int fileMode)
|
||||||
|
{
|
||||||
|
return BasicOpenFile(fileName, fileFlags, fileMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static inline File
|
||||||
|
PathNameOpenFilePerm(FileName fileName, int fileFlags, int fileMode)
|
||||||
|
{
|
||||||
|
return PathNameOpenFile(fileName, fileFlags, fileMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* VERSION_COMPAT_H */
|
#endif /* VERSION_COMPAT_H */
|
||||||
|
|
Loading…
Reference in New Issue