Merge pull request #25391 from taosdata/enh/TD-28945-pk
cos/multi-writing: init fid & cid for s3 page cache
This commit is contained in:
commit
a4edab720c
|
@ -149,7 +149,7 @@ typedef enum EOperatorType {
|
|||
OP_TYPE_BIT_OR,
|
||||
|
||||
// binary comparison operator
|
||||
OP_TYPE_GREATER_THAN = 40, // MUST KEEP IT FIRST AT COMPARE SECTION
|
||||
OP_TYPE_GREATER_THAN = 40, // MUST KEEP IT FIRST AT COMPARE SECTION
|
||||
OP_TYPE_GREATER_EQUAL,
|
||||
OP_TYPE_LOWER_THAN,
|
||||
OP_TYPE_LOWER_EQUAL,
|
||||
|
@ -170,7 +170,7 @@ typedef enum EOperatorType {
|
|||
OP_TYPE_IS_NOT_TRUE,
|
||||
OP_TYPE_IS_NOT_FALSE,
|
||||
OP_TYPE_IS_NOT_UNKNOWN,
|
||||
OP_TYPE_COMPARE_MAX_VALUE = 149, // MUST KEEP IT LAST AT COMPARE SECTION
|
||||
OP_TYPE_COMPARE_MAX_VALUE = 149, // MUST KEEP IT LAST AT COMPARE SECTION
|
||||
|
||||
// json operator
|
||||
OP_TYPE_JSON_GET_VALUE = 150,
|
||||
|
@ -417,7 +417,7 @@ typedef enum ELogicConditionType {
|
|||
#define TSDB_MAX_HASH_SUFFIX (TSDB_TABLE_NAME_LEN - 2)
|
||||
#define TSDB_DEFAULT_HASH_SUFFIX 0
|
||||
|
||||
#define TSDB_MIN_S3_CHUNK_SIZE (32 * 1024)
|
||||
#define TSDB_MIN_S3_CHUNK_SIZE (128 * 1024)
|
||||
#define TSDB_MAX_S3_CHUNK_SIZE (1024 * 1024)
|
||||
#define TSDB_DEFAULT_S3_CHUNK_SIZE (256 * 1024)
|
||||
#define TSDB_MIN_S3_KEEP_LOCAL (1 * 1440) // unit minute
|
||||
|
|
|
@ -267,29 +267,25 @@ int32_t tsdbTFileObjUnref(STFileObj *fobj) {
|
|||
}
|
||||
|
||||
static void tsdbTFileObjRemoveLC(STFileObj *fobj, bool remove_all) {
|
||||
if (fobj->f->type != TSDB_FTYPE_DATA) {
|
||||
if (fobj->f->type != TSDB_FTYPE_DATA || fobj->f->lcn < 1) {
|
||||
remove_file(fobj->fname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!remove_all) {
|
||||
if (fobj->f->lcn < 1) {
|
||||
remove_file(fobj->fname);
|
||||
// remove local last chunk file
|
||||
char lc_path[TSDB_FILENAME_LEN];
|
||||
tstrncpy(lc_path, fobj->fname, TSDB_FQDN_LEN);
|
||||
|
||||
char *dot = strrchr(lc_path, '.');
|
||||
if (!dot) {
|
||||
tsdbError("unexpected path: %s", lc_path);
|
||||
return;
|
||||
} else {
|
||||
// remove local last chunk file
|
||||
char lc_path[TSDB_FILENAME_LEN];
|
||||
tstrncpy(lc_path, fobj->fname, TSDB_FQDN_LEN);
|
||||
|
||||
char *dot = strrchr(lc_path, '.');
|
||||
if (!dot) {
|
||||
tsdbError("unexpected path: %s", lc_path);
|
||||
return;
|
||||
}
|
||||
snprintf(dot + 1, TSDB_FQDN_LEN - (dot + 1 - lc_path), "%d.data", fobj->f->lcn);
|
||||
|
||||
remove_file(lc_path);
|
||||
}
|
||||
snprintf(dot + 1, TSDB_FQDN_LEN - (dot + 1 - lc_path), "%d.data", fobj->f->lcn);
|
||||
|
||||
remove_file(lc_path);
|
||||
|
||||
} else {
|
||||
// delete by data file prefix
|
||||
char lc_path[TSDB_FILENAME_LEN];
|
||||
|
|
|
@ -30,6 +30,10 @@ static int32_t tsdbOpenFileImpl(STsdbFD *pFD) {
|
|||
char lc_path[TSDB_FILENAME_LEN];
|
||||
tstrncpy(lc_path, path, TSDB_FQDN_LEN);
|
||||
|
||||
int32_t vid = 0;
|
||||
const char *object_name = taosDirEntryBaseName((char *)path);
|
||||
sscanf(object_name, "v%df%dver%" PRId64 ".data", &vid, &pFD->fid, &pFD->cid);
|
||||
|
||||
char *dot = strrchr(lc_path, '.');
|
||||
if (!dot) {
|
||||
tsdbError("unexpected path: %s", lc_path);
|
||||
|
|
Loading…
Reference in New Issue