Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/issue 590 improve the fault tolerance of materialized view #597

Conversation

yl-lisen
Copy link
Collaborator

@yl-lisen yl-lisen commented Mar 11, 2024

resolve #590 and close #598

Please write user-readable short description of the changes:

  • Add an abstract class DB::Streaming::ISource
  • Support more recovery policy RecoveryPolicy via a setting settings recovery_policy='strict' or 'best_effort':
    - Strict      /// Always recover from checkpointed
    - BestEffort  /// Attempt to recover from checkpointed and allow skipping of some data with permanent errors
    
  • Add more information in error log (include the description for streaming source and sequence number (such as progressed sn, checkpointed sn, recovered sn)

If we need know what's the dirty data, we can use the following statement to query data within the specified sn range (checkpointed_sn, processed_sn]:

select * from source_stream where _tp_sn > checkpointed_sn and _tp_sn <= processed_sn
-- or
select * from source_mv where _tp_sn > checkpointed_sn and _tp_sn <= processed_sn

Usually, the data at processed_sn is the cause of the error

@yl-lisen yl-lisen self-assigned this Mar 11, 2024
@yl-lisen yl-lisen force-pushed the enhancement/issue-590-improve-the-fault-tolerance-of-materialized-view branch from 5d1834a to ee6f1a9 Compare March 13, 2024 11:35
@yl-lisen yl-lisen marked this pull request as ready for review March 13, 2024 11:42

Int64 lastCheckpointedSN() const noexcept { return last_checkpointed_sn; }

void checkpoint(CheckpointContextPtr ckpt_ctx_) override final;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make checkpoint non virtual and remove the checkpoint, recover interface from DB::ISource?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the checkpoint/recover virtual interface is defined in IProcessor

@yl-lisen yl-lisen force-pushed the enhancement/issue-590-improve-the-fault-tolerance-of-materialized-view branch from b296a23 to a718cc6 Compare March 20, 2024 09:32
@chenziliang chenziliang merged commit 6c272a4 into develop Mar 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Poison event caused MV to be unable to progress and recover improve the fault tolerance of materialized view
2 participants