Skip to content

Conversation

@pauloricardomg
Copy link
Contributor

Thanks for sending a pull request! Here are some tips if you're new here:

  • Ensure you have added or run the appropriate tests for your PR.
  • Be sure to keep the PR description updated to reflect all changes.
  • Write your PR title to summarize what this PR proposes.
  • If possible, provide a concise example to reproduce the issue for a faster review.
  • Read our contributor guidelines
  • If you're making a documentation change, see our guide to documentation contribution

Commit messages should follow the following format:

<One sentence description, usually Jira title or CHANGES.txt summary>

<Optional lengthier description (context on patch)>

patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####

Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>

The Cassandra Jira

@pauloricardomg pauloricardomg changed the base branch from trunk to cassandra-5.0 January 12, 2026 16:24
pauloricardomg and others added 3 commits January 23, 2026 14:34
This forward ports the Apache Cassandra Unified Repair Solution (CEP-37) from
cassandra-4.1 (commit 858a7f3) to cassandra-5.0, adapting the implementation
for 5.0 API changes.

Key API adaptations:
- Migrated from BigTableScanner to SSTableReader.getPositionsForRanges() API
- Updated RepairRunnable references to RepairCoordinator (CASSANDRA-18816)
- Fixed SSTableIntervalTree.build() to buildSSTableIntervalTree()
- Updated Descriptor.baseFilename() to baseFile().name()
- Updated AUTH_TABLE_NAMES to include CIDR_PERMISSIONS, CIDR_GROUPS, and
  IDENTITY_TO_ROLES for 5.0
- Changed from bytesOnDisk() to onDiskLength() for SSTable size calculations

Includes bug fixes and features:
- Improved observability in AutoRepair (CASSANDRA-20581)
- Stop repair scheduler if two major versions detected (CASSANDRA-20048)
- Safeguard Full repair against disk protection (CASSANDRA-20045)
- Stop AutoRepair monitoring thread upon shutdown (CASSANDRA-20623)
- Fix race condition in auto-repair scheduler (CASSANDRA-20265)
- Minimum repair task duration setting (CASSANDRA-20160)
- Preview_repaired auto-repair type (CASSANDRA-20046)

patch by Paulo Motta; reviewed by Jaydeepkumar Chovatia for CASSANDRA-19918

Co-Authored-By: Andy Tolbert <andy_tolbert@apple.com>
Co-Authored-By: Chris Lohfink <clohfink@netflix.com>
Co-Authored-By: Francisco Guerrero <frankgh@apache.org>
Co-Authored-By: Himanshu Jindal <himanshj@amazon.com>
Co-Authored-By: Jaydeepkumar Chovatia <jchovati@uber.com>
Co-Authored-By: Kristijonas Zalys <kzalys@uber.com>
Co-Authored-By: jaydeepkumar1984 <chovatia.jaydeep@gmail.com>
Adds a guard that blocks auto-repair when any cluster node has a version
below 5.0.7 or an unknown version, ensuring the feature only runs when
all nodes support it.
Introduces cassandra.autorepair.enable property (default: false) that
completely disables auto-repair when set to false. When disabled:
- No MBean registration
- No service initialization
- No scheduler setup
- No bootstrap integration
- No auto_repair_history/auto_repair_priority tables created
- No auto_repair column written to schema

System table creation and schema property additions are conditional on
cassandra.autorepair.enable. This allows users who never enable the
feature to keep the old schema and not be affected by auto-repair
schema changes.

Implementation details:
- auto_repair column in system_schema.tables and system_schema.views is
  conditionally included based on cassandra.autorepair.enable at class
  load time
- SchemaKeyspace.addTableParamsToRowBuilder checks if column exists
  before writing data to avoid errors on schema without the column
- Distributed tests verify flag toggle behavior and schema properties
- Unit test replaced with distributed tests that properly initialize
  JVM properties before schema loading

WARNING: This property is non-reversible. Once enabled, it cannot be
disabled. Attempting to start a node with the property disabled after
it was previously enabled will cause schema incompatibility errors
(the persisted schema contains auto-repair columns that are not
recognized when the property is disabled).
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.

1 participant