Merge pull request #25465 from taosdata/fix/TD-29759
fix(s3migrate/datas3): init fd of from & to early
This commit is contained in:
commit
b1fb14e49e
|
@ -557,6 +557,7 @@ static int32_t tsdbMigrateDataFileS3(SRTNer *rtner, const STFileObj *fobj, int64
|
|||
int32_t lino = 0;
|
||||
STFileOp op = {0};
|
||||
int32_t lcn = (size - 1) / chunksize + 1;
|
||||
TdFilePtr fdFrom = NULL, fdTo = NULL;
|
||||
|
||||
// remove old
|
||||
op = (STFileOp){
|
||||
|
@ -615,7 +616,6 @@ static int32_t tsdbMigrateDataFileS3(SRTNer *rtner, const STFileObj *fobj, int64
|
|||
}
|
||||
|
||||
// copy last chunk
|
||||
TdFilePtr fdFrom = NULL, fdTo = NULL;
|
||||
int64_t lc_offset = (int64_t)(lcn - 1) * chunksize;
|
||||
int64_t lc_size = size - lc_offset;
|
||||
|
||||
|
|
Loading…
Reference in New Issue