calc hash use src_filename when it not empty

pull/484/head
YuQing 2019-12-04 20:19:43 +08:00
parent 856ef15ab7
commit 01041705ba
1 changed files with 13 additions and 2 deletions

View File

@ -1071,6 +1071,7 @@ static int do_dispatch_binlog_for_threads(const char *pBasePath)
RecoveryDispatchInfo *dispatchs; RecoveryDispatchInfo *dispatchs;
RecoveryDispatchInfo *disp; RecoveryDispatchInfo *disp;
int64_t total_count; int64_t total_count;
int hash_code;
int bytes; int bytes;
int result; int result;
int i; int i;
@ -1128,8 +1129,18 @@ static int do_dispatch_binlog_for_threads(const char *pBasePath)
break; break;
} }
disp = dispatchs + (unsigned int)(Time33Hash(record.filename, if (record.src_filename_len > 0)
record.filename_len)) % g_disk_recovery_threads; {
hash_code = Time33Hash(record.src_filename,
record.src_filename_len);
}
else
{
hash_code = Time33Hash(record.filename,
record.filename_len);
}
disp = dispatchs + ((unsigned int)hash_code) %
g_disk_recovery_threads;
if ((result=disk_recovery_write_to_binlog(disp->fp, if ((result=disk_recovery_write_to_binlog(disp->fp,
disp->temp_filename, &record)) != 0) disp->temp_filename, &record)) != 0)
{ {