remove debug info

pull/348/head
YuQing 2019-10-23 16:50:40 +08:00
parent 77da832e05
commit 461e78ca30
2 changed files with 20 additions and 13 deletions

View File

@ -565,7 +565,7 @@ static int setupSchedules(pthread_t *schedule_tid)
{ {
INIT_SCHEDULE_ENTRY_EX(scheduleEntries[scheduleArray.count], INIT_SCHEDULE_ENTRY_EX(scheduleEntries[scheduleArray.count],
scheduleArray.count + 1, g_compress_binlog_time, scheduleArray.count + 1, g_compress_binlog_time,
60, fdfs_binlog_compress_func, NULL); 24 * 3600, fdfs_binlog_compress_func, NULL);
scheduleArray.count++; scheduleArray.count++;
} }

View File

@ -1606,6 +1606,23 @@ static inline char *get_binlog_readable_filename(const void *pArg,
full_filename); full_filename);
} }
static void get_binlog_flag_file(const char *filepath,
char *flag_filename, const int size)
{
const char *filename;
filename = strrchr(filepath, '/');
if (filename == NULL)
{
snprintf(flag_filename, size, ".%s.flag", filepath);
}
else
{
snprintf(flag_filename, size, "%.*s.%s.flag",
(int)(filename - filepath + 1), filepath, filename + 1);
}
}
static int uncompress_binlog_file(StorageBinLogReader *pReader, static int uncompress_binlog_file(StorageBinLogReader *pReader,
const char *filename) const char *filename)
{ {
@ -1623,8 +1640,7 @@ static int uncompress_binlog_file(StorageBinLogReader *pReader,
return errno != 0 ? errno : ENOENT; return errno != 0 ? errno : ENOENT;
} }
snprintf(flag_filename, sizeof(flag_filename), get_binlog_flag_file(filename, flag_filename, sizeof(flag_filename));
"%s.flag", filename);
if (stat(flag_filename, &flag_stat) == 0) if (stat(flag_filename, &flag_stat) == 0)
{ {
if (g_current_time - flag_stat.st_mtime > 3600) if (g_current_time - flag_stat.st_mtime > 3600)
@ -1704,8 +1720,7 @@ static int compress_binlog_file(const char *filename)
return errno != 0 ? errno : ENOENT; return errno != 0 ? errno : ENOENT;
} }
snprintf(flag_filename, sizeof(flag_filename), get_binlog_flag_file(filename, flag_filename, sizeof(flag_filename));
"%s.flag", filename);
if (stat(flag_filename, &flag_stat) == 0) if (stat(flag_filename, &flag_stat) == 0)
{ {
if (g_current_time - flag_stat.st_mtime > 3600) if (g_current_time - flag_stat.st_mtime > 3600)
@ -3242,18 +3257,10 @@ static int calc_compress_until_binlog_index()
int min_index; int min_index;
pthread_mutex_lock(&sync_thread_lock); pthread_mutex_lock(&sync_thread_lock);
logInfo("g_storage_sync_thread_count: %d, reader count: %d", g_storage_sync_thread_count, fc_list_count(&reader_head));
min_index = g_binlog_index; min_index = g_binlog_index;
fc_list_for_each_entry(pReader, &reader_head, link) fc_list_for_each_entry(pReader, &reader_head, link)
{ {
if (pReader->binlog_fd >= 0)
{
logInfo("storage_id: %s, binlog_fd: %d, binlog_index: %d, binlog_offset: %"PRId64,
pReader->storage_id, pReader->binlog_fd,
pReader->binlog_index, pReader->binlog_offset);
}
if (pReader->binlog_fd >= 0 && pReader->binlog_index >= 0 && if (pReader->binlog_fd >= 0 && pReader->binlog_index >= 0 &&
pReader->binlog_index < min_index) pReader->binlog_index < min_index)
{ {