cos/multi-writing: init fid & cid for s3 page cache

This commit is contained in:
Minglei Jin 2024-04-17 19:48:50 +08:00
parent c43c0cf427
commit 7034cbee22
3 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -291,6 +291,10 @@ static void tsdbTFileObjRemoveLC(STFileObj *fobj, bool remove_all) {
remove_file(lc_path);
}
} else {
if (fobj->f->lcn < 1) {
remove_file(fobj->fname);
return;
}
// delete by data file prefix
char lc_path[TSDB_FILENAME_LEN];
tstrncpy(lc_path, fobj->fname, TSDB_FQDN_LEN);

View File

@ -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);