Skip to content

Conversation

@singhravidutt
Copy link
Contributor

@singhravidutt singhravidutt commented Oct 27, 2025

Added checksum failure metric. This will capture the number of failures per FS instance.

@gemini-code-assist
Copy link

Summary of Changes

Hello @singhravidutt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the monitoring capabilities of the GCS Connector by introducing a new metric to specifically count checksum failures during write operations. This provides crucial visibility into potential data corruption or integrity issues, allowing operators to quickly identify and address problems related to data persistence. The change integrates seamlessly with the existing statistics and event bus infrastructure.

Highlights

  • New Metric for Checksum Failures: Introduced a new metric, WRITE_CHECKSUM_FAILURE_COUNT, to specifically track data integrity issues that occur during write operations to Google Cloud Storage.
  • Event-Driven Metric Increment: Implemented an event-driven mechanism where the new checksum failure metric is automatically incremented whenever a CRC32C mismatch is detected during a write operation.
  • Dedicated Checksum Failure Event: Added a new GCSChecksumFailureEvent class and a corresponding postWriteChecksumFailure method in GoogleCloudStorageEventBus to facilitate the publishing and handling of these specific events.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively introduces a new metric for tracking write checksum failures. The implementation correctly uses the existing event bus mechanism by adding a new GCSChecksumFailureEvent and a subscriber to update the WRITE_CHECKSUM_FAILURE_COUNT statistic. The changes are logical and include a new test case to verify the functionality. I have a couple of minor suggestions to enhance code clarity and robustness.

}

@Subscribe
private void onGcsChecksumFailure(GCSChecksumFailureEvent exception) {

Choose a reason for hiding this comment

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

medium

The parameter name exception is a bit misleading here. Although GCSChecksumFailureEvent extends Exception, in this context, it's functioning as an event rather than a handled exception. Renaming it to event would improve code clarity and better reflect its purpose within the event bus system.

Suggested change
private void onGcsChecksumFailure(GCSChecksumFailureEvent exception) {
private void onGcsChecksumFailure(GCSChecksumFailureEvent event) {

package com.google.cloud.hadoop.util;

/** A thin class to emit checksum failure event for EventBus notification. */
public class GCSChecksumFailureEvent extends Exception {}

Choose a reason for hiding this comment

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

medium

To improve code robustness and clearly state its intent, this class should be declared as final. Since it serves as a simple marker event and is not designed for extension, making it final prevents subclassing.

Suggested change
public class GCSChecksumFailureEvent extends Exception {}
public final class GCSChecksumFailureEvent extends Exception {}

@singhravidutt
Copy link
Contributor Author

/gcbrun

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.61%. Comparing base (fb964ce) to head (8899132).
⚠️ Report is 58 commits behind head on branch-3.0.x.

Additional details and impacted files
@@                Coverage Diff                 @@
##             branch-3.0.x    #1555      +/-   ##
==================================================
+ Coverage           82.03%   82.61%   +0.58%     
- Complexity           1972     2181     +209     
==================================================
  Files                 114      120       +6     
  Lines                8615     9428     +813     
  Branches             1004     1130     +126     
==================================================
+ Hits                 7067     7789     +722     
- Misses               1121     1173      +52     
- Partials              427      466      +39     
Flag Coverage Δ
integrationtest 67.43% <30.00%> (+0.60%) ⬆️
unittest 72.87% <100.00%> (-0.31%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@dheerajsngh dheerajsngh left a comment

Choose a reason for hiding this comment

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

Why is it showing the parent as :
#1230 ?
Please update.

Also please update the PR title to not include #1549, as that is generally the PR number but here the #PR is 1555.

Please include the Original PR in the PR description.

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