src/backend/logging/loggers/wal_frontend_logger.cpp
/**
 * @brief get the next frame size
 *  TupleRecord consiss of two frame ( header and Body)
 *  Transaction Record has a single frame
 * @return the next frame size
 */
@brief get the next frame size
TupleRecord consiss of two frame ( header and Body)
Transaction Record has a single frame
@return the next frame size
@brief get the next frame size TupleRecord consiss of two frame ( header and Body ) Transaction Record has a single frame @return the next frame size
size_t GetNextFrameSize(FILE *log_file, size_t log_file_size) {
  size_t frame_size;
  char buffer[sizeof(int32_t)];
  if (IsFileTruncated(log_file, sizeof(buffer), log_file_size)) {
    return 0;
  }
  size_t ret = fread(buffer, 1, sizeof(buffer), log_file);
  if (ret <= 0) {
    LOG_ERROR("Error occured in fread ");
  }
  CopySerializeInputBE frameCheck(buffer, sizeof(buffer));
  frame_size = (frameCheck.ReadInt()) + sizeof(buffer);
  int res = fseek(log_file, -sizeof(buffer), SEEK_CUR);
  if (res == -1) {
    LOG_ERROR("Error occured in fseek ");
  }
  if (IsFileTruncated(log_file, frame_size, log_file_size)) {
    return 0;
  }
  return frame_size;
}
size_t GetNextFrameSize ( FILE * log_file , size_t log_file_size ) { size_t frame_size ; char buffer [ sizeof ( int32_t ) ] ; if ( IsFileTruncated ( log_file , sizeof ( buffer ) , log_file_size ) ) { return 0 ; } size_t ret = fread ( buffer , 1 , sizeof ( buffer ) , log_file ) ; if ( ret <= 0 ) { LOG_ERROR ( " " ) ; } CopySerializeInputBE frameCheck ( buffer , sizeof ( buffer ) ) ; frame_size = ( frameCheck . ReadInt ( ) ) + sizeof ( buffer ) ; int res = fseek ( log_file , - sizeof ( buffer ) , SEEK_CUR ) ; if ( res == -1 ) { LOG_ERROR ( " " ) ; } if ( IsFileTruncated ( log_file , frame_size , log_file_size ) ) { return 0 ; } return frame_size ; }
@brief get the next frame size
  TupleRecord consiss of two frame ( header and Body)
  Transaction Record has a single frame
 @return the next frame size
@brief get the next frame size TupleRecord consiss of two frame ( header and Body ) Transaction Record has a single frame @return the next frame size
// Check if the frame size is broken // Otherwise, read the frame size // Read next 4 bytes as an integer // Move back by 4 bytes // So that tuple deserializer works later as expected // Check if the frame is broken