You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/03/26 07:22:42 UTC

[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10594: Fix additional table is not created for the next day

kezhenxu94 commented on code in PR #10594:
URL: https://github.com/apache/skywalking/pull/10594#discussion_r1148495211


##########
oap-server/server-storage-plugin/storage-jdbc-hikaricp-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/jdbc/common/JDBCTableInstaller.java:
##########
@@ -86,15 +88,16 @@ public boolean isExists(Model model) {
     @Override
     @SneakyThrows
     public void createTable(Model model) {
-        final var table = TableHelper.getLatestTableForWrite(model);
-        createTable(model, table);
+        final var dayTimeBucket = TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Day);
+        createTable(model, dayTimeBucket);
     }
 
     @SneakyThrows
-    public void createTable(Model model, String table) {
+    public void createTable(Model model, long timeBucket) {
+        final var table = TableHelper.getTable(model, timeBucket);
         createOrUpdateTable(table, model.getColumns(), false);
         createOrUpdateTableIndexes(table, model.getColumns(), false);
-        createAdditionalTable(model);
+        createAdditionalTable(model, timeBucket);

Review Comment:
   `createAdditionalTable` always used the current day timebucket to create a new table, when the `JDBCHistoryDeleteDAO` is creating tables for next day, the additional tables won't be created



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org