@@ -151,8 +151,8 @@ static int apply_queue_size()
151151/* Assume caller holds sql_apply_queue_lock */
152152static inline int block_apply_queue (bdb_state_type * bdb_state )
153153{
154- while (((apply_queue_head + 1 ) % gbl_sql_logfill_lookahead_records ) == apply_queue_tail &&
155- ! db_is_exiting () && !bdb_lock_desired (bdb_state )) {
154+ while (((apply_queue_head + 1 ) % gbl_sql_logfill_lookahead_records ) == apply_queue_tail && ! db_is_exiting () &&
155+ !bdb_lock_desired (bdb_state )) {
156156 enque_blocks ++ ;
157157 if (gbl_debug_sql_logfill ) {
158158 static int lastpr = 0 ;
@@ -171,8 +171,8 @@ static inline int block_apply_queue(bdb_state_type *bdb_state)
171171 return db_is_exiting () || bdb_lock_desired (bdb_state );
172172}
173173
174- static void enque_log_record (bdb_state_type * bdb_state , unsigned int file , unsigned int offset ,
175- int64_t rectype , u_int32_t recgen , void * blob , int blob_len )
174+ static void enque_log_record (bdb_state_type * bdb_state , unsigned int file , unsigned int offset , int64_t rectype ,
175+ u_int32_t recgen , void * blob , int blob_len )
176176{
177177 Pthread_mutex_lock (& sql_apply_queue_lock );
178178
@@ -204,8 +204,8 @@ static void enque_log_record(bdb_state_type *bdb_state, unsigned int file, unsig
204204 Pthread_mutex_unlock (& sql_apply_queue_lock );
205205}
206206
207- static int handle_log (bdb_state_type * bdb_state , unsigned int file , unsigned int offset ,
208- int64_t rectype , u_int32_t recgen , void * blob , int blob_len )
207+ static int handle_log (bdb_state_type * bdb_state , unsigned int file , unsigned int offset , int64_t rectype ,
208+ u_int32_t recgen , void * blob , int blob_len )
209209{
210210 if (gbl_sql_logfill_dedicated_apply_thread ) {
211211 enque_log_record (bdb_state , file , offset , rectype , recgen , blob , blob_len );
@@ -245,7 +245,8 @@ static void print_record_info(const char *prefix, cdb2_hndl_tp *hndl)
245245static int gen_okay (bdb_state_type * bdb_state , cdb2_hndl_tp * hndl , u_int32_t mygen )
246246{
247247 int64_t * recgenp = (int64_t * )cdb2_column_value (hndl , 2 );
248- if (!recgenp ) return 1 ;
248+ if (!recgenp )
249+ return 1 ;
249250 return * recgenp <= mygen ;
250251}
251252
@@ -270,7 +271,8 @@ static int apply_record(bdb_state_type *bdb_state, cdb2_hndl_tp *hndl, LOG_INFO
270271 }
271272
272273 if (last_lsn -> file < mylsn .file ) {
273- rc = handle_log (bdb_state , last_lsn -> file , get_next_offset (bdb_state -> dbenv , * last_lsn ), REP_NEWFILE , genp ? * genp : 0 , NULL , 0 );
274+ rc = handle_log (bdb_state , last_lsn -> file , get_next_offset (bdb_state -> dbenv , * last_lsn ), REP_NEWFILE ,
275+ genp ? * genp : 0 , NULL , 0 );
274276 if (rc != 0 ) {
275277 logmsg (LOGMSG_FATAL , "%s error applying newfile log record, %d\n" , __func__ , rc );
276278 exit (1 );
@@ -371,8 +373,8 @@ static void request_logs_from_master(bdb_state_type *bdb_state)
371373 gap_lsn = master_lsn ;
372374 }
373375
374- rc = snprintf (sql_cmd , SQL_CMD_LEN , "select * from comdb2_transaction_logs('{%u:%u}', NULL, 9, 1)" ,
375- last_lsn .file , last_lsn .offset );
376+ rc = snprintf (sql_cmd , SQL_CMD_LEN , "select * from comdb2_transaction_logs('{%u:%u}', NULL, 9, 1)" ,
377+ last_lsn .file , last_lsn .offset );
376378 if (rc < 0 || rc >= SQL_CMD_LEN ) {
377379 logmsg (LOGMSG_ERROR , "%s: snprintf failed, rc=%d\n" , __func__ , rc );
378380 return ;
@@ -426,8 +428,8 @@ static void request_logs_from_master(bdb_state_type *bdb_state)
426428 if (!gen_okay (bdb_state , hndl , gen )) {
427429 if (gbl_debug_sql_logfill ) {
428430 int64_t * recgenp = (int64_t * )cdb2_column_value (hndl , 2 );
429- logmsg (LOGMSG_USER , "%s: exiting apply loop, mygen=%u recgen=%" PRId64 "\n" , __func__ ,
430- gen , recgenp ? * recgenp : 0 );
431+ logmsg (LOGMSG_USER , "%s: exiting apply loop, mygen=%u recgen=%" PRId64 "\n" , __func__ , gen ,
432+ recgenp ? * recgenp : 0 );
431433 }
432434 break ;
433435 }
@@ -571,17 +573,16 @@ static void *apply_thread(void *arg)
571573 u_int32_t gen ;
572574 bdb_state -> dbenv -> get_rep_gen (bdb_state -> dbenv , & gen );
573575 if (copy .recgen == 0 || gen >= copy .recgen ) {
574- bdb_state -> dbenv -> apply_log (bdb_state -> dbenv , copy .file , copy .offset ,
575- copy . rectype , copy . blob , copy .blob_len );
576+ bdb_state -> dbenv -> apply_log (bdb_state -> dbenv , copy .file , copy .offset , copy . rectype , copy . blob ,
577+ copy .blob_len );
576578 } else if (gbl_debug_sql_logfill ) {
577- logmsg (LOGMSG_USER , "%s: skipping apply of recgen=%u mygen=%u\n" , __func__ ,
578- copy .recgen , gen );
579+ logmsg (LOGMSG_USER , "%s: skipping apply of recgen=%u mygen=%u\n" , __func__ , copy .recgen , gen );
579580 }
580581 }
581582
582583 Pthread_mutex_lock (& sql_apply_queue_lock );
583584 if (apply_gen == apply_queue_gen ) {
584- if (tail != apply_queue_tail )
585+ if (tail != apply_queue_tail )
585586 abort ();
586587 apply_queue_tail = (apply_queue_tail + 1 ) % gbl_sql_logfill_lookahead_records ;
587588 }
0 commit comments