clarax opened a new pull request, #463:
URL: https://github.com/apache/flink-kubernetes-operator/pull/463

   … last savepoint in the SavepointInfo.lastSavepoint field whether it is 
completed or pending
   
   
   ## What is the purpose of the change
   
   End user experience proposal:
   
   User can see the properties of last savepoint pending or completed and can 
get status in one of three states for the status: PENDING, SUCCEEDED and 
ABANDONED. If there is never savepoint taken or attempted, it is empty. 
Completed savepoints (manual, periodic and upgrade) are included Savepoint 
history, merged with savepoints form Flink job.
   
   User can manually trigger a savepoint. If there is another savepoint 
pending, triggering is disabled. User can see this savepoint with PENDING 
status. Once completed, user can see last savepoint status changed to SUCCEEDED 
and included in savepoint history or ABANDONED and not in savepoint history. If 
there is other savepoint triggered after completion before user checks, user 
cannot see the status of the one they triggered but they can check if the 
savepoint is in the history.
   
   Currently lastSavepoint only stores the last completed one, duplicate with 
savepoint history.
   
   To expose the properties of the currently pending savepoint or last 
savepoint that failed, we need to expose those info in separate fields in 
SavepointInfo. The internal logic of Operator uses those fields for triggering 
and retries and creates compatibility issues with client.
   
   Code change proposal:
   
   Use lastSavepoint to store the last completed/attempted one and remove 
SavepointInfo.triggerTimstamp, SavepointInfo.triggerType and 
SavepointInfo.formatType.
   
   Add SavepointInfo::retrieveLastSavepoint method to return the last succeeded 
one.
   
   Update getLastSavepointStatus to simplify the logic and change 
SavepointStatus.ABANDONED state to FAILED.
   
   This is a breaking change:
    - Existing application using lastSavepoint or trigger related fields in 
Savepoint info except triggerId may be broken. 
    - For triggerId dependence, better use SavepointUtils.savepointInProgress 
which is guaranteed to work.
    - savepointHistory is not changed and still keeps the completed savepoints 
only. Unit tests for savepoint history also cover a few scenarios.
   
   ## Brief change log
   
     - Use Savepoint.lastSavepoint to store last savepoint, completed or 
attempted .
     - Added SavepointInfo::retrieveLastCompletedSavepoint() method to find the 
last completed one.
     - Updated related logic.
     - Added migration logic to handle lingering trigger information on old CR
   
   ## Verifying this change
   This change added tests and can be verified as follows:
   
   *(example:)*
     - Updated existing tests to check for regression.
     - Added tests for migration and backward compatibility with old CR
     - Updated e2e testes to remove tests that are no longer needed
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changes to the `CustomResourceDescriptors`: 
no
     - Core observer or reconciler logic that is regularly executed: yes
   
   ## Documentation
   
     - Does this pull request introduce a new feature? yes
     - If yes, how is the feature documented?  JavaDocs and will roll into 
public doc
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to