pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Started by Bruce Momjianover 15 years ago7 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
it is 8k as expected.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=9dd7933937a076ce7573944b8d1d42e618163440

Modified Files
--------------
contrib/pg_test_fsync/pg_test_fsync.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#1)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Bruce Momjian <bruce@momjian.us> writes:

Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
it is 8k as expected.

-#define WRITE_SIZE (8 * 1024)  /* 8k */
+#if XLOG_BLCKSZ != 8 * 1024  /* 8k */
+#error Unknown block size for test.
+#endif

This seems like a pretty awful idea. Aren't you aware that XLOG_BLCKSZ
is settable from a configure option? You just broke the ability to
build the tree with a non-default configuration setting.

If you aren't willing to deal with a variable value for the block size,
please revert this patch.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, but verify
it is 8k as expected.

-#define WRITE_SIZE (8 * 1024)  /* 8k */
+#if XLOG_BLCKSZ != 8 * 1024  /* 8k */
+#error Unknown block size for test.
+#endif

This seems like a pretty awful idea. Aren't you aware that XLOG_BLCKSZ
is settable from a configure option? You just broke the ability to
build the tree with a non-default configuration setting.

If you aren't willing to deal with a variable value for the block size,
please revert this patch.

The problem is that I have hard-coded 8k into various text strings and I
didn't want to make that variable. How should it behave if they are
using a non-8k wal buffer size? Should it still use 8k or not? I
figured throwing an error would at least alert them to the mismatch.

Good point on the build problem --- I had not thought of that. Throwing
an error when running makes more sense, but let's figure out what it
should do.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Bruce Momjian <bruce@momjian.us> writes:

Tom Lane wrote:

If you aren't willing to deal with a variable value for the block size,
please revert this patch.

The problem is that I have hard-coded 8k into various text strings and I
didn't want to make that variable. How should it behave if they are
using a non-8k wal buffer size? Should it still use 8k or not? I
figured throwing an error would at least alert them to the mismatch.

Well, as I said, if you aren't willing to put effort into that point,
just revert the patch. Making the program refuse to do anything doesn't
help *anyone*. Stats taken using a fixed 8K blocksize are better than
no stats at all.

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

Tom Lane wrote:

If you aren't willing to deal with a variable value for the block size,
please revert this patch.

The problem is that I have hard-coded 8k into various text strings and I
didn't want to make that variable. How should it behave if they are
using a non-8k wal buffer size? Should it still use 8k or not? I
figured throwing an error would at least alert them to the mismatch.

Well, as I said, if you aren't willing to put effort into that point,
just revert the patch. Making the program refuse to do anything doesn't
help *anyone*. Stats taken using a fixed 8K blocksize are better than
no stats at all.

Sure I am willing to fix it. Should I have it always use the value of
XLOG_BLCKSZ for its tests, and adjust the output text accordingly?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#5)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Bruce Momjian <bruce@momjian.us> writes:

Sure I am willing to fix it. Should I have it always use the value of
XLOG_BLCKSZ for its tests, and adjust the output text accordingly?

Makes sense to me.

regards, tom lane

#7Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#6)
Re: pgsql: Use XLOG_BLCKSZ in pg_test_fsync, rather than our own define, bu

Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

Sure I am willing to fix it. Should I have it always use the value of
XLOG_BLCKSZ for its tests, and adjust the output text accordingly?

Makes sense to me.

OK, done with attached patch. I also cleaned up the open_sync size test
output. The patch was easy. Thanks for the ideas.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

Attachments:

/rtmp/fsync.difftext/x-diffDownload+24-24