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

WIP: Module Improvements / Fixes for Schema Reversion #190

Draft
wants to merge 5 commits into
base: 8.x
Choose a base branch
from

Conversation

lcatlett
Copy link
Member

1. Implement Proper Core Reload Functionality

Changes:

  • Add explicit core reload calls after schema updates.
  • Verify core reload success.
  • Add retry mechanism for failed reloads.

Architecture Review:

  • Core Reload Calls: Ensure that after any schema update, the Solr core is explicitly reloaded to apply changes.
  • Verification: Implement a method to verify the success of the core reload by checking the core status.
  • Retry Mechanism: Introduce a retry mechanism with exponential backoff to handle transient failures during core reloads.

Code Changes:

  • Modify PantheonSolrConnector.php to include core reload calls and verification.
  • Add retry logic in the reloadCore method.

2. Improve Configuration Persistence

Changes:

  • Store complete Solr configuration in Drupal's config system.
  • Implement proper config update hooks.
  • Add configuration validation.

Architecture Review:

  • Configuration Storage: Utilize Drupal's configuration management system to store and retrieve Solr configurations.
  • Update Hooks: Implement hooks to handle configuration updates and ensure they are applied correctly.
  • Validation: Add validation logic to ensure the configuration is correct before applying it.

Code Changes:

  • Update PantheonSolrConnector.php to store configuration in Drupal's config system.
  • Implement hook_update_N functions to handle configuration updates.
  • Add validation methods in SchemaValidator.php.

3. Add Safeguards

Changes:

  • Validate schema compatibility before updates.
  • Implement rollback mechanism for failed updates.
  • Add configuration version tracking.

Architecture Review:

  • Schema Validation: Before applying any schema updates, validate the schema to ensure compatibility.
  • Rollback Mechanism: Implement a mechanism to rollback to the previous schema if an update fails.
  • Version Tracking: Track the version of the configuration to detect and handle mismatches.

Code Changes:

  • Add schema validation in SchemaValidator.php.
  • Implement rollback logic in SchemaPoster.php.
  • Track configuration versions in CoreStatusMonitor.php.

4. Improve Error Handling

Changes:

  • Add proper exception handling.
  • Implement retry mechanisms.
  • Add detailed logging.
  • Provide better user feedback.

Architecture Review:

  • Exception Handling: Ensure all critical operations have proper exception handling to catch and log errors.
  • Retry Mechanisms: Implement retry logic for operations that can fail transiently.
  • Logging: Enhance logging to provide detailed information about errors and operations.
  • User Feedback: Provide clear and actionable feedback to users when errors occur.

Code Changes:

  • Update SolariumClient.php and PantheonSolrConnector.php to include detailed logging and exception handling.
  • Implement retry logic in methods that interact with Solr.

5. Add Monitoring

Changes:

  • Track schema versions.
  • Monitor core status.
  • Alert on configuration mismatches.

Architecture Review:

  • Schema Version Tracking: Track the current schema version and compare it with the expected version.
  • Core Status Monitoring: Regularly check the status of the Solr core to ensure it is running correctly.
  • Alerts: Implement alerts to notify administrators of configuration mismatches or other issues.

Code Changes:

  • Add schema version tracking in CoreStatusMonitor.php.
  • Implement core status monitoring in CoreStatusMonitor.php.
  • Add alerting logic to notify administrators of issues.

WIP #### 6. Migrate to new Pantheon config-set (vs jumpstart):

  • Create an update hook to migrate existing installations to new pantheon default config-set
  • Modifies SchemaPoster to use the new config-set structure
  • Handles merging of default and custom configurations
  • Maintains backward compatibility


while ($attempt < $maxAttempts) {
try {
$response = $this->pantheonGuzzle->get('admin/cores', [
Copy link
Member

Choose a reason for hiding this comment

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

/admin/cores is inaccessible from the standard pantheon environment. We have a process for reloading the core.

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