Skip to content

PHOENIX-7792 New file age check before processing during replay#2423

Open
Himanshu-g81 wants to merge 1 commit intoapache:PHOENIX-7562-feature-newfrom
Himanshu-g81:PHOENIX-7792
Open

PHOENIX-7792 New file age check before processing during replay#2423
Himanshu-g81 wants to merge 1 commit intoapache:PHOENIX-7562-feature-newfrom
Himanshu-g81:PHOENIX-7792

Conversation

@Himanshu-g81
Copy link
Copy Markdown
Contributor

During replay, we now wait before processing a new file to ensure it's no longer being written by the source cluster. A file must be at least roundTime + configurable % old (default: 15%) before it becomes eligible. For the default 60s round time, that's 69s.

When some files are old enough, we process those immediately. When all remaining files are too young, we sleep for exactly the time needed until the oldest one becomes eligible.

…e possibility of files being open during replay
files = replicationLogTracker.getNewFilesForRound(replicationRound);
List<Path> allFiles = replicationLogTracker.getNewFilesForRound(replicationRound);
LOG.info("Number of new files for round {} is {}", replicationRound, allFiles.size());
long minAgeMs = getNewFileMinAgeMs();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This won't be changing right from one round to another right. We can avoid computing it everytime

List<Path> allFiles = replicationLogTracker.getNewFilesForRound(replicationRound);
LOG.info("Number of new files for round {} is {}", replicationRound, allFiles.size());
long minAgeMs = getNewFileMinAgeMs();
while (!allFiles.isEmpty()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I highly recommend adding isRunning check here.

Suggested change
while (!allFiles.isEmpty()) {
while (!allFiles.isEmpty() && isRunning) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Himanshu-g81 As discussed offline we may not need this PR but I still think we should add the isRunning check to prevent stalling RS stop operation.

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.

2 participants