Skip to content

Commit

Permalink
chore(controller):tune dump period and add more logs (#2630)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldenxinxing authored Aug 21, 2023
1 parent 2b50faf commit 7c83c23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public DataStore(StorageAccessService storageAccessService,
@Value("${sw.datastore.oss-max-attempts}") int ossMaxAttempts,
@Value("${sw.datastore.data-root-path:}") String dataRootPath,
@Value("${sw.datastore.dump-interval:1h}") String dumpInterval,
@Value("${sw.datastore.min-no-update-period:1d}") String minNoUpdatePeriod,
@Value("${sw.datastore.min-no-update-period:4h}") String minNoUpdatePeriod,
@Value("${sw.datastore.parquet.compression-codec:SNAPPY}") String compressionCodec,
@Value("${sw.datastore.parquet.row-group-size:128MB}") String rowGroupSize,
@Value("${sw.datastore.parquet.page-size:1MB}") String pageSize,
Expand All @@ -99,15 +99,18 @@ public DataStore(StorageAccessService storageAccessService,
this.parquetConfig.setPageSize((int) DataSize.parse(pageSize).toBytes());
this.parquetConfig.setPageRowCountLimit(pageRowCountLimit);
var it = this.walManager.readAll();
log.info("Start to load wal log...");
while (it.hasNext()) {
var entry = it.next();
var table = this.getTable(entry.getTableName(), true, true);
log.info("Loading wal log for table:{}.", entry.getTableName());
//noinspection ConstantConditions
table.updateFromWal(entry);
if (table.getFirstWalLogId() >= 0) {
this.dirtyTables.put(table, "");
}
}
log.info("Finished load wal log...");
this.dumpThread = new DumpThread(DurationStyle.detectAndParse(dumpInterval).toMillis(),
DurationStyle.detectAndParse(minNoUpdatePeriod).toMillis());
this.dumpThread.start();
Expand Down
4 changes: 2 additions & 2 deletions server/controller/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ sw:
oss-max-attempts: ${SW_DATASTORE_WAL_INIT_MAX_ATTEMPTS:3}
data-root-path: ${SW_DATASTORE_DATA_ROOT_PATH:}
dump-interval: ${SW_DATASTORE_DUMP_INTERVAL:1h}
min-no-update-period: ${SW_DATASTORE_MIN_NO_UPDATE_PERIOD:1d}
min-no-update-period: ${SW_DATASTORE_MIN_NO_UPDATE_PERIOD:4h}
parquet:
compression-codec: ${SW_DATASTORE_PARQUET_COMPRESSION_CODEC:SNAPPY}
row-group-size: ${SW_DATASTORE_PARQUET_ROW_GROUP_SIZE:128MB}
Expand Down Expand Up @@ -157,7 +157,7 @@ server:
logging:
level:
root: ${SW_ROOT_LOG_LEVEL:warn}
ai.starwhale.mlops: ${SW_BIZ_LOG_LEVEL:warn}
ai.starwhale.mlops: ${SW_BIZ_LOG_LEVEL:info}
org.springframework.web.filter.CommonsRequestLoggingFilter: ${SW_REQUEST_LOG_LEVEL:info}

management:
Expand Down

0 comments on commit 7c83c23

Please sign in to comment.