Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19617

make ezcache.php script warning user when it has to be run on all nodes in a cluster

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 2012.8, 4.7.0-dev, 5.0.0-dev
    • None

    Description

      typical case is: user clears cache on node A, but cache is not cleared on node B.
      Ideal solution would be intra-cluster communication.
      Ad interim solution is to warn user that he should run the same script on all nodes in the cluster.

      Proof-of-concept code:

      function clearItems( $cacheEntries, $cli, $name )
      {
          if ( !$name )
              $name = 'All cache';
          $name = $cli->stylize( 'emphasize', $name );
          $cli->output( 'Clearing ' . $name . ': ' );
      
          checkPaths( $cacheEntries, false );
      
          $i = 0;
          foreach ( $cacheEntries as $cacheEntry )
          {
              if ( $i > 0 )
                  $cli->output( ', ', false );
              $cli->output( $cli->stylize( 'emphasize', $cacheEntry['name'] ), false );
                  eZCache::clearItem( $cacheEntry );
              if ( !isset( $cacheEntry['is-clustered'] ) || !$cacheEntry['is-clustered'] ) {
                  $cl = eZClusterFileHandler::instance();
                  if ( $cl->requiresPurge() )
                  {
                          $cli->output("\nNB: this cache is not clustered. You'd better run the script on all nodes");
                  }
              }
              ++$i;
          }
          $cli->output();
      }
      

      Attachments

        Activity

          People

            unknown unknown
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - 0 minutes
                0m