fix(tsdb/s3): fix scan and fix with s3 files
This commit is contained in:
parent
88f6596965
commit
f299ae9bc3
|
@ -16,6 +16,7 @@
|
||||||
#include "tsdbFS2.h"
|
#include "tsdbFS2.h"
|
||||||
#include "tsdbUpgrade.h"
|
#include "tsdbUpgrade.h"
|
||||||
#include "vnd.h"
|
#include "vnd.h"
|
||||||
|
#include "vndCos.h"
|
||||||
|
|
||||||
extern int vnodeScheduleTask(int (*execute)(void *), void *arg);
|
extern int vnodeScheduleTask(int (*execute)(void *), void *arg);
|
||||||
extern int vnodeScheduleTaskEx(int tpid, int (*execute)(void *), void *arg);
|
extern int vnodeScheduleTaskEx(int tpid, int (*execute)(void *), void *arg);
|
||||||
|
@ -365,6 +366,14 @@ static int32_t tsdbFSDoScanAndFixFile(STFileSystem *fs, const STFileObj *fobj) {
|
||||||
|
|
||||||
// check file existence
|
// check file existence
|
||||||
if (!taosCheckExistFile(fobj->fname)) {
|
if (!taosCheckExistFile(fobj->fname)) {
|
||||||
|
if (tsS3Enabled) {
|
||||||
|
const char *object_name = taosDirEntryBaseName((char *)fobj->fname);
|
||||||
|
long s3_size = s3Size(object_name);
|
||||||
|
if (s3_size > 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
code = TSDB_CODE_FILE_CORRUPTED;
|
code = TSDB_CODE_FILE_CORRUPTED;
|
||||||
tsdbError("vgId:%d %s failed since file:%s does not exist", TD_VID(fs->tsdb->pVnode), __func__, fobj->fname);
|
tsdbError("vgId:%d %s failed since file:%s does not exist", TD_VID(fs->tsdb->pVnode), __func__, fobj->fname);
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -26,8 +26,8 @@ static int32_t tsdbOpenFileImpl(STsdbFD *pFD) {
|
||||||
if (pFD->pFD == NULL) {
|
if (pFD->pFD == NULL) {
|
||||||
int errsv = errno;
|
int errsv = errno;
|
||||||
const char *object_name = taosDirEntryBaseName((char *)path);
|
const char *object_name = taosDirEntryBaseName((char *)path);
|
||||||
long s3_size = s3Size(object_name);
|
long s3_size = tsS3Enabled ? s3Size(object_name) : 0;
|
||||||
if (!strncmp(path + strlen(path) - 5, ".data", 5) && s3_size > 0) {
|
if (tsS3Enabled && !strncmp(path + strlen(path) - 5, ".data", 5) && s3_size > 0) {
|
||||||
s3EvictCache(path, s3_size);
|
s3EvictCache(path, s3_size);
|
||||||
s3Get(object_name, path);
|
s3Get(object_name, path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue