mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Clean up pg_test_fsync commit.
Actually rename the program, rather than just claiming we did. Hook it into the build system. Get rid of useless dependency on libpq. Clean up #include list and messy whitespace.
This commit is contained in:
parent
0cf3db2175
commit
bc616703e8
@ -33,6 +33,7 @@ SUBDIRS = \
|
|||||||
pg_freespacemap \
|
pg_freespacemap \
|
||||||
pg_standby \
|
pg_standby \
|
||||||
pg_stat_statements \
|
pg_stat_statements \
|
||||||
|
pg_test_fsync \
|
||||||
pg_trgm \
|
pg_trgm \
|
||||||
pg_upgrade \
|
pg_upgrade \
|
||||||
pg_upgrade_support \
|
pg_upgrade_support \
|
||||||
|
@ -30,7 +30,7 @@ adminpack -
|
|||||||
|
|
||||||
auth_delay
|
auth_delay
|
||||||
Add a short delay after a failed authentication attempt, to make
|
Add a short delay after a failed authentication attempt, to make
|
||||||
brute-force attacks on database passwords a bit harder.
|
brute-force attacks on database passwords a bit harder.
|
||||||
by KaiGai Kohei <kaigai@ak.jp.nec.com>
|
by KaiGai Kohei <kaigai@ak.jp.nec.com>
|
||||||
|
|
||||||
auto_explain -
|
auto_explain -
|
||||||
@ -71,7 +71,7 @@ dict_xsyn -
|
|||||||
|
|
||||||
earthdistance -
|
earthdistance -
|
||||||
Functions for computing distances between two points on Earth
|
Functions for computing distances between two points on Earth
|
||||||
by Bruno Wolff III <bruno@wolff.to> and Hal Snyder <hal@vailsys.com>
|
by Bruno Wolff III <bruno@wolff.to> and Hal Snyder <hal@vailsys.com>
|
||||||
|
|
||||||
fuzzystrmatch -
|
fuzzystrmatch -
|
||||||
Levenshtein, metaphone, and soundex fuzzy string matching
|
Levenshtein, metaphone, and soundex fuzzy string matching
|
||||||
@ -129,6 +129,10 @@ pg_stat_statements -
|
|||||||
Track statement execution times across a whole database cluster
|
Track statement execution times across a whole database cluster
|
||||||
by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
|
by Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>
|
||||||
|
|
||||||
|
pg_test_fsync -
|
||||||
|
Test different wal_sync_method settings
|
||||||
|
by Bruce Momjian <bruce@momjian.us>
|
||||||
|
|
||||||
pg_trgm -
|
pg_trgm -
|
||||||
Functions for determining the similarity of text based on trigram
|
Functions for determining the similarity of text based on trigram
|
||||||
matching.
|
matching.
|
||||||
|
1
contrib/pg_test_fsync/.gitignore
vendored
Normal file
1
contrib/pg_test_fsync/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/pg_test_fsync
|
@ -1,22 +1,20 @@
|
|||||||
#
|
#
|
||||||
# Makefile for test_fsync
|
# Makefile for pg_test_fsync
|
||||||
#
|
#
|
||||||
# contrib/test_fsync/Makefile
|
# contrib/pg_test_fsync/Makefile
|
||||||
|
|
||||||
PGFILEDESC = "test_fsync - test various disk sync methods"
|
PGFILEDESC = "pg_test_fsync - test various disk sync methods"
|
||||||
PGAPPICON = win32
|
PGAPPICON = win32
|
||||||
|
|
||||||
PROGRAM = test_fsync
|
PROGRAM = pg_test_fsync
|
||||||
OBJS = test_fsync.o
|
OBJS = pg_test_fsync.o
|
||||||
|
|
||||||
PG_LIBS = $(libpq_pgport)
|
|
||||||
|
|
||||||
ifdef USE_PGXS
|
ifdef USE_PGXS
|
||||||
PG_CONFIG = pg_config
|
PG_CONFIG = pg_config
|
||||||
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
||||||
include $(PGXS)
|
include $(PGXS)
|
||||||
else
|
else
|
||||||
subdir = contrib/test_fsync
|
subdir = contrib/pg_test_fsync
|
||||||
top_builddir = ../..
|
top_builddir = ../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
include $(top_srcdir)/contrib/contrib-global.mk
|
include $(top_srcdir)/contrib/contrib-global.mk
|
||||||
|
@ -1,31 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
* test_fsync.c
|
* pg_test_fsync.c
|
||||||
* tests all supported fsync() methods
|
* tests all supported fsync() methods
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "getopt_long.h"
|
#include "getopt_long.h"
|
||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xlogdefs.h"
|
#include "access/xlogdefs.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* put the temp files in the local directory
|
* put the temp files in the local directory
|
||||||
* unless the user specifies otherwise
|
* unless the user specifies otherwise
|
||||||
*/
|
*/
|
||||||
#define FSYNC_FILENAME "./test_fsync.out"
|
#define FSYNC_FILENAME "./pg_test_fsync.out"
|
||||||
|
|
||||||
#define WRITE_SIZE (8 * 1024) /* 8k */
|
#define WRITE_SIZE (8 * 1024) /* 8k */
|
||||||
|
|
||||||
@ -92,12 +88,12 @@ handle_args(int argc, char *argv[])
|
|||||||
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
|
if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-h") == 0 ||
|
||||||
strcmp(argv[1], "-?") == 0)
|
strcmp(argv[1], "-?") == 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "test_fsync [-f filename] [ops-per-test]\n");
|
fprintf(stderr, "pg_test_fsync [-f filename] [ops-per-test]\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
|
if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"test_fsync " PG_VERSION "\n");
|
fprintf(stderr,"pg_test_fsync " PG_VERSION "\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,7 +114,7 @@ handle_args(int argc, char *argv[])
|
|||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Try \"%s --help\" for more information.\n",
|
"Try \"%s --help\" for more information.\n",
|
||||||
"test_fsync");
|
"pg_test_fsync");
|
||||||
exit(1);
|
exit(1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -477,8 +473,8 @@ test_file_descriptor_sync(void)
|
|||||||
* This simulates processes fsyncing each other's
|
* This simulates processes fsyncing each other's
|
||||||
* writes.
|
* writes.
|
||||||
*/
|
*/
|
||||||
printf(LABEL_FORMAT, "write, close, fsync");
|
printf(LABEL_FORMAT, "write, close, fsync");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
gettimeofday(&start_t, NULL);
|
gettimeofday(&start_t, NULL);
|
||||||
for (ops = 0; ops < ops_per_test; ops++)
|
for (ops = 0; ops < ops_per_test; ops++)
|
@ -40,7 +40,7 @@ pg_test_fsync [options]
|
|||||||
This file should be in the same file system that the
|
This file should be in the same file system that the
|
||||||
<filename>pg_xlog</> directory is or will be placed in.
|
<filename>pg_xlog</> directory is or will be placed in.
|
||||||
(<filename>pg_xlog</> contains the <acronym>WAL</> files.)
|
(<filename>pg_xlog</> contains the <acronym>WAL</> files.)
|
||||||
The default is <filename>test_fsync.out</> in the current
|
The default is <filename>pg_test_fsync.out</> in the current
|
||||||
directory.
|
directory.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user