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

[Tiered Storage] Add logs for cleanup offloaded data operation #9852

Merged
merged 3 commits into from
Mar 11, 2021

Conversation

gaoran10
Copy link
Contributor

@gaoran10 gaoran10 commented Mar 9, 2021

Motivation

The cleanup offloaded data operation was lack of logs, it's hard for users to analyze the tiered storage data loss reason.

Modifications

Add some logs for the cleanup offloaded data operation.

@@ -2764,6 +2764,7 @@ private void offloadLoop(CompletableFuture<PositionImpl> promise, Queue<LedgerIn
scheduledExecutor, name)
.whenComplete((ignore2, exception) -> {
if (exception != null) {
log.error("Failed to offload data for ledgerId {}", ledgerId, exception);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to also print the managed ledger name so that we can distinguish which topic occurs the problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll fix.

Copy link
Member

Choose a reason for hiding this comment

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

For consistency, it might be helpful to also add the ledger's name to the warning log that occurs when the cleanup offload fails (line 2962).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@michaeljmarshall Ok, thanks for reminding me.

@@ -2954,6 +2955,7 @@ private void cleanupOffloaded(long ledgerId, UUID uuid, String offloadDriverName
* identify offloader
*/
Map<String, String> offloadDriverMetadata, String cleanupReason) {
log.info("cleanup offloaded data uuid {} for reason {}", uuid.toString(), cleanupReason);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to also print the managed ledger name so that we can distinguish which topic occurs the problem. And also print the ledgerId? it's useful for debugging.

Use info level log looks good here since the cleanupOffloaded only happens while offload failed right @gaoran10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think the cleanup offloaded data is a low-frequency operation.

@codelipenghui codelipenghui added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Mar 10, 2021
@codelipenghui codelipenghui added this to the 2.8.0 milestone Mar 10, 2021
@@ -2764,6 +2764,7 @@ private void offloadLoop(CompletableFuture<PositionImpl> promise, Queue<LedgerIn
scheduledExecutor, name)
.whenComplete((ignore2, exception) -> {
if (exception != null) {
log.error("Failed to offload data for ledgerId {}", ledgerId, exception);
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, it might be helpful to also add the ledger's name to the warning log that occurs when the cleanup offload fails (line 2962).

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

LGTM

@codelipenghui codelipenghui merged commit 3120a4b into apache:master Mar 11, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Mar 23, 2021
codelipenghui pushed a commit that referenced this pull request Mar 23, 2021
### Motivation

The cleanup offloaded data operation was lack of logs, it's hard for users to analyze the tiered storage data loss reason.

### Modifications

Add some logs for the cleanup offloaded data operation.

(cherry picked from commit 3120a4b)
@gaoran10 gaoran10 deleted the cleanup-offload-data-log branch September 10, 2021 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tieredstorage cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.2 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants