Skip to content

Commit

Permalink
fix: warnings when compiling neon extensions (#7053)
Browse files Browse the repository at this point in the history
proceeding #7010, close
#6188

## Summary of changes

This pull request (should) fix all warnings except
`-Wdeclaration-after-statement` in the neon extension compilation.

---------

Signed-off-by: Alex Chi Z <chi@neon.tech>
  • Loading branch information
skyzh committed Mar 11, 2024
1 parent 17a3c90 commit 73a8c97
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pgxn/hnsw/hnsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ hnsw_check_available_memory(Size requested)
struct sysinfo si;
Size total;
if (sysinfo(&si) < 0)
elog(ERROR, "Failed to get amount of RAM: %n");
elog(ERROR, "Failed to get amount of RAM: %m");

total = si.totalram*si.mem_unit;
if ((Size)NBuffers*BLCKSZ + requested >= total)
Expand Down
1 change: 0 additions & 1 deletion pgxn/neon/extension_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ neon_download_extension_file_http(const char *filename, bool is_library)

CURLcode res;
char *compute_ctl_url;
char *postdata;
bool ret = false;

if (handle == NULL)
Expand Down
4 changes: 0 additions & 4 deletions pgxn/neon/neon.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ get_num_snap_files_lsn_threshold(void)
DIR *dirdesc;
struct dirent *de;
char *snap_path = "pg_logical/snapshots/";
int cnt = 0;
int lsns_allocated = 1024;
int lsns_num = 0;
XLogRecPtr *lsns;
Expand Down Expand Up @@ -161,9 +160,6 @@ get_num_snap_files_lsn_threshold(void)
PGDLLEXPORT void
LogicalSlotsMonitorMain(Datum main_arg)
{
TimestampTz now,
last_checked;

/* Establish signal handlers. */
pqsignal(SIGUSR1, procsignal_sigusr1_handler);
pqsignal(SIGHUP, SignalHandlerForConfigReload);
Expand Down
1 change: 0 additions & 1 deletion pgxn/neon/pagestore_smgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,6 @@ neon_zeroextend(SMgrRelation reln, ForkNumber forkNum, BlockNumber blocknum,
int nblocks, bool skipFsync)
{
const PGAlignedBlock buffer = {0};
BlockNumber curblocknum = blocknum;
int remblocks = nblocks;
XLogRecPtr lsn = 0;

Expand Down
3 changes: 1 addition & 2 deletions pgxn/neon/walproposer_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ static void
StartProposerReplication(WalProposer *wp, StartReplicationCmd *cmd)
{
XLogRecPtr FlushPtr;
TimeLineID currTLI;
__attribute__((unused)) TimeLineID currTLI;

#if PG_VERSION_NUM < 150000
if (ThisTimeLineID == 0)
Expand Down Expand Up @@ -1230,7 +1230,6 @@ WalProposerRecovery(WalProposer *wp, Safekeeper *sk)
TimeLineID timeline;
XLogRecPtr startpos;
XLogRecPtr endpos;
uint64 download_range_mb;

startpos = GetLogRepRestartLSN(wp);
if (startpos == InvalidXLogRecPtr)
Expand Down
2 changes: 0 additions & 2 deletions pgxn/neon_test_utils/neontest.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ test_consume_memory(PG_FUNCTION_ARGS)
Datum
test_release_memory(PG_FUNCTION_ARGS)
{
TimestampTz start;

if (PG_ARGISNULL(0))
{
if (consume_cxt)
Expand Down
3 changes: 3 additions & 0 deletions pgxn/neon_walredo/walredoproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ enter_seccomp_mode(void)
}
#endif /* HAVE_LIBSECCOMP */

PGDLLEXPORT void
WalRedoMain(int argc, char *argv[]);

/*
* Entry point for the WAL redo process.
*
Expand Down

1 comment on commit 73a8c97

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2576 tests run: 2442 passed, 1 failed, 133 skipped (full report)


Failures on Postgres 14

  • test_bulk_insert[neon-github-actions-selfhosted]: release
# Run all failed tests locally:
scripts/pytest -vv -n $(nproc) -k "test_bulk_insert[neon-release-pg14-github-actions-selfhosted]"
Flaky tests (1)

Postgres 16

  • test_compute_pageserver_connection_stress: release

Code coverage* (full report)

  • functions: 28.8% (7032 of 24443 functions)
  • lines: 47.6% (43453 of 91297 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
73a8c97 at 2024-03-11T18:38:07.214Z :recycle:

Please sign in to comment.