You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "SteNicholas (via GitHub)" <gi...@apache.org> on 2023/05/16 06:16:22 UTC

[GitHub] [hudi] SteNicholas opened a new pull request, #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

SteNicholas opened a new pull request, #8722:
URL: https://github.com/apache/hudi/pull/8722

   ### Change Logs
   
   Procedure parameter `instant_time`/`commit_time` of savepoint procedure optional could be optional and uses the latest instant when the value of `instant_time`/`commit_time` is null or empty.
   
   ### Impact
   
   Support `instant_time/commit_time` of savepoint procedure including `create_savepoint`, `delete_savepoint` and `rollback_to_savepoint` optional.
   
   ### Risk level (write none, low medium or high below)
   
   None
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Change Logs and Impact were stated clearly
   - [x] Adequate tests were added if applicable
   - [x] CI passed


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549090480

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] leesf commented on a diff in pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "leesf (via GitHub)" <gi...@apache.org>.
leesf commented on code in PR #8722:
URL: https://github.com/apache/hudi/pull/8722#discussion_r1195144430


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -609,36 +609,64 @@ public void savepoint(String user, String comment) {
    * <p>
    * Savepoint should be on a commit that could not have been cleaned.
    *
-   * @param instantTime - commit that should be savepointed
-   * @param user - User creating the savepoint
-   * @param comment - Comment for the savepoint
+   * @param instantTime Commit that should be savepointed
+   * @param user        User creating the savepoint
+   * @param comment     Comment for the savepoint
    */
   public void savepoint(String instantTime, String user, String comment) {
     HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
     table.savepoint(context, instantTime, user, comment);
   }
 
+  /**
+   * Delete a savepoint based on the latest commit action on the savepoint timeline.
+   */
+  public void deleteSavepoint() {
+    HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
+    HoodieTimeline savePointTimeline = table.getActiveTimeline().getSavePointTimeline();
+    if (savePointTimeline.empty()) {
+      throw new HoodieSavepointException("Could not savepoint. Commit timeline is empty");

Review Comment:
   `Could not delete savepoint, savepoint timeline is empty?`



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549081951

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] leesf commented on a diff in pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "leesf (via GitHub)" <gi...@apache.org>.
leesf commented on code in PR #8722:
URL: https://github.com/apache/hudi/pull/8722#discussion_r1195144430


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -609,36 +609,64 @@ public void savepoint(String user, String comment) {
    * <p>
    * Savepoint should be on a commit that could not have been cleaned.
    *
-   * @param instantTime - commit that should be savepointed
-   * @param user - User creating the savepoint
-   * @param comment - Comment for the savepoint
+   * @param instantTime Commit that should be savepointed
+   * @param user        User creating the savepoint
+   * @param comment     Comment for the savepoint
    */
   public void savepoint(String instantTime, String user, String comment) {
     HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
     table.savepoint(context, instantTime, user, comment);
   }
 
+  /**
+   * Delete a savepoint based on the latest commit action on the savepoint timeline.
+   */
+  public void deleteSavepoint() {
+    HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
+    HoodieTimeline savePointTimeline = table.getActiveTimeline().getSavePointTimeline();
+    if (savePointTimeline.empty()) {
+      throw new HoodieSavepointException("Could not savepoint. Commit timeline is empty");

Review Comment:
   `Could not delete savepoint, Savepoint timeline is empty?`



-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549500303

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549713856

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111) 
   * cb4f488503cf264c847e493d6fcf10019892528a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] SteNicholas commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549166850

   @yihua, @xiarixiaoyao, PTAL.


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] leesf merged pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "leesf (via GitHub)" <gi...@apache.org>.
leesf merged PR #8722:
URL: https://github.com/apache/hudi/pull/8722


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1550451566

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17128",
       "triggerID" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * cb4f488503cf264c847e493d6fcf10019892528a Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17128) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] hudi-bot commented on pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8722:
URL: https://github.com/apache/hudi/pull/8722#issuecomment-1549733252

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111",
       "triggerID" : "1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17128",
       "triggerID" : "cb4f488503cf264c847e493d6fcf10019892528a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 1cf7d0fe626c1f3423b51e683bbb4c07017f9f7a Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17111) 
   * cb4f488503cf264c847e493d6fcf10019892528a Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17128) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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


[GitHub] [hudi] leesf commented on a diff in pull request #8722: [HUDI-6218] Support instant_time/commit_time of savepoint procedure optional

Posted by "leesf (via GitHub)" <gi...@apache.org>.
leesf commented on code in PR #8722:
URL: https://github.com/apache/hudi/pull/8722#discussion_r1195145768


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -609,36 +609,64 @@ public void savepoint(String user, String comment) {
    * <p>
    * Savepoint should be on a commit that could not have been cleaned.
    *
-   * @param instantTime - commit that should be savepointed
-   * @param user - User creating the savepoint
-   * @param comment - Comment for the savepoint
+   * @param instantTime Commit that should be savepointed
+   * @param user        User creating the savepoint
+   * @param comment     Comment for the savepoint
    */
   public void savepoint(String instantTime, String user, String comment) {
     HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
     table.savepoint(context, instantTime, user, comment);
   }
 
+  /**
+   * Delete a savepoint based on the latest commit action on the savepoint timeline.
+   */
+  public void deleteSavepoint() {
+    HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
+    HoodieTimeline savePointTimeline = table.getActiveTimeline().getSavePointTimeline();
+    if (savePointTimeline.empty()) {
+      throw new HoodieSavepointException("Could not savepoint. Commit timeline is empty");
+    }
+
+    String savepointTime = savePointTimeline.lastInstant().get().getTimestamp();
+    LOG.info("Deleting latest savepoint time " + savepointTime);
+    deleteSavepoint(savepointTime);
+  }
+
   /**
    * Delete a savepoint that was created. Once the savepoint is deleted, the commit can be rolledback and cleaner may
    * clean up data files.
    *
-   * @param savepointTime - delete the savepoint
-   * @return true if the savepoint was deleted successfully
+   * @param savepointTime Savepoint time to delete
    */
   public void deleteSavepoint(String savepointTime) {
     HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
     SavepointHelpers.deleteSavepoint(table, savepointTime);
   }
 
+  /**
+   * Restore the data to a savepoint based on the latest commit action on the savepoint timeline.
+   */
+  public void restoreToSavepoint() {
+    HoodieTable<T, I, K, O> table = createTable(config, hadoopConf);
+    HoodieTimeline savePointTimeline = table.getActiveTimeline().getSavePointTimeline();
+    if (savePointTimeline.empty()) {
+      throw new HoodieSavepointException("Could not savepoint. Commit timeline is empty");

Review Comment:
   ditto



-- 
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: commits-unsubscribe@hudi.apache.org

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