jenkins-bot has submitted this change and it was merged.
Change subject: Fix up logic for cleaning up old shard allocations
......................................................................
Fix up logic for cleaning up old shard allocations
Change-Id: Ib9f494578ed85174e555378df08cfab4caf14716
---
M includes/Maintenance/ShardAllocation.php
1 file changed, 8 insertions(+), 7 deletions(-)
Approvals:
Manybubbles: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Maintenance/ShardAllocation.php
b/includes/Maintenance/ShardAllocation.php
index cf3803e..2bfa114 100644
--- a/includes/Maintenance/ShardAllocation.php
+++ b/includes/Maintenance/ShardAllocation.php
@@ -41,16 +41,17 @@
$this->out->outputIndented( "\tUpdating '$type'
allocations..." );
$this->set( $type, $desired );
$this->out->output( "done\n" );
- } elseif( !$desired && isset( $actual[$type] ) ) {
- $keys = array_filter( array_keys(
$actual[$type] ),
- function( $key ) use ( $actual, $type )
{
- return $actual[$type][$key] !==
'';
+ }
+ if( isset( $actual[$type] ) ) {
+ $undesired = array_filter( array_keys(
$actual[$type] ),
+ function( $key ) use ( $actual, $type,
$desired ) {
+ return $actual[$type][$key] !==
'' && !isset( $desired[$key] );
}
);
- if ( $keys ) {
- $this->out->outputIndented( "\tDeleting
'$type' allocations..." );
- $this->set( $type, array_fill_keys(
$keys, '' ) );
+ if ( $undesired ) {
+ $this->out->outputIndented( "\tClearing
'$type' allocations..." );
+ $this->set( $type, array_fill_keys(
$undesired, '' ) );
$this->out->output( "done\n" );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/147178
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9f494578ed85174e555378df08cfab4caf14716
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits