diff --git a/pgxn/neon/communicator/src/neon_request.rs b/pgxn/neon/communicator/src/neon_request.rs index 98bdbb8822..6b0ee9341b 100644 --- a/pgxn/neon/communicator/src/neon_request.rs +++ b/pgxn/neon/communicator/src/neon_request.rs @@ -45,8 +45,8 @@ pub enum NeonIOResult { /// the result pages are written to the shared memory addresses given in the request GetPageV, - /// The result is written to the shared memory address given in the - /// request. The [`u64`] value here is the number of blocks. + /// The result is written to the file, path to which is provided + /// in the request. The [`u64`] value here is the number of blocks. ReadSlruSegment(u64), /// A prefetch request returns as soon as the request has been received by the communicator. @@ -194,7 +194,8 @@ pub struct CReadSlruSegmentRequest { } impl CReadSlruSegmentRequest { - /// Returns the path to the file where the segment is read into. + /// Returns the file path where the communicator will write the + /// SLRU segment. pub(crate) fn destination_file_path(&self) -> String { unsafe { CStr::from_ptr(self.destination_file_path.as_mut_ptr() as *const _) } .to_string_lossy() diff --git a/pgxn/neon/communicator_new.c b/pgxn/neon/communicator_new.c index 8b2fc258ee..f18523bf9c 100644 --- a/pgxn/neon/communicator_new.c +++ b/pgxn/neon/communicator_new.c @@ -1015,15 +1015,15 @@ communicator_new_read_slru_segment( } }; int nblocks = -1; - char *abs_path = bounce_buf(); + char *temp_path = bounce_buf(); if (path == NULL) { elog(ERROR, "read_slru_segment called with NULL path"); return -1; } - strlcpy(abs_path, path, Min(PATH_MAX, strlen(path) + 1)); - request.read_slru_segment.destination_file_path.ptr = (uint8_t *) abs_path; + strlcpy(temp_path, path, Min(PATH_MAX, strlen(path) + 1)); + request.read_slru_segment.destination_file_path.ptr = (uint8_t *) temp_path; elog(DEBUG5, "readslrusegment called for kind=%u, segno=%u, file_path=\"%s\"", kind, segno, request.read_slru_segment.destination_file_path.ptr);