@@ -1293,7 +1293,7 @@ static void *journalfile_v2_write_descriptors(struct journal_v2_header *j2_heade
12931293// startup : if the migration is done during agent startup
12941294// this will allow us to optimize certain things
12951295
1296- void journalfile_migrate_to_v2_callback (Word_t section , unsigned datafile_fileno __maybe_unused , uint8_t type __maybe_unused ,
1296+ bool journalfile_migrate_to_v2_callback (Word_t section , unsigned datafile_fileno __maybe_unused , uint8_t type __maybe_unused ,
12971297 Pvoid_t JudyL_metrics , Pvoid_t JudyL_extents_pos ,
12981298 size_t number_of_extents , size_t number_of_metrics , size_t number_of_pages , void * user_data )
12991299{
@@ -1346,8 +1346,10 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
13461346
13471347 int fd_v2 ;
13481348 uint8_t * data_start = nd_mmap_advanced (path , total_file_size , MAP_SHARED , 0 , false, true, & fd_v2 );
1349- if (!data_start )
1350- out_of_memory (__FUNCTION__ , total_file_size , path );
1349+ if (!data_start ) {
1350+ nd_log_daemon (NDLP_WARNING , "DBENGINE: Failed to allocate %" PRIu64 " bytes of memory for journal file '%s'. Will retry later" , total_file_size , path );
1351+ return false;
1352+ }
13511353
13521354 memset (data_start , 0 , extent_offset );
13531355
@@ -1492,7 +1494,7 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
14921494 internal_error (true, "DBENGINE: ACTIVATING NEW INDEX JNL %llu" , (now_monotonic_usec () - start_loading ) / USEC_PER_MS );
14931495 ctx_current_disk_space_increase (ctx , total_file_size );
14941496 freez (uuid_list );
1495- return ;
1497+ return true ;
14961498 }
14971499 else {
14981500 netdata_log_info ("DBENGINE: failed to build index '%s', file will be skipped" , path );
@@ -1506,7 +1508,7 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
15061508 freez (uuid_list );
15071509
15081510 if (likely (resize_file_to == total_file_size ))
1509- return ;
1511+ return true ;
15101512
15111513 int ret = truncate (path , (long ) resize_file_to );
15121514 if (ret < 0 ) {
@@ -1516,6 +1518,8 @@ void journalfile_migrate_to_v2_callback(Word_t section, unsigned datafile_fileno
15161518 }
15171519 else
15181520 ctx_current_disk_space_increase (ctx , resize_file_to );
1521+
1522+ return true;
15191523}
15201524
15211525int journalfile_load (struct rrdengine_instance * ctx , struct rrdengine_journalfile * journalfile ,
0 commit comments