Ottomata has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/355469 )

Change subject: Trigger a rerun of druid-hdfs-storage-cdh-link during a Druid 
upgrade
......................................................................

Trigger a rerun of druid-hdfs-storage-cdh-link during a Druid upgrade

Bug: T164008
Change-Id: Ic304fbce899a9d51fe35959fac191822ac59229c
---
M modules/druid/files/druid-hdfs-storage-cdh-link.sh
M modules/druid/manifests/cdh/hadoop/dependencies.pp
2 files changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/69/355469/1

diff --git a/modules/druid/files/druid-hdfs-storage-cdh-link.sh 
b/modules/druid/files/druid-hdfs-storage-cdh-link.sh
index b42e370..f0e66f5 100755
--- a/modules/druid/files/druid-hdfs-storage-cdh-link.sh
+++ b/modules/druid/files/druid-hdfs-storage-cdh-link.sh
@@ -19,7 +19,7 @@
 
     # We need to link to the druid-hdfs-storage jar from the $source directory.
     if [ "${base_jar}" == 'druid-hdfs-storage.jar' ]; then
-        ln -sfv $storage_jar ${dest}/
+        ln -sfv $storage_jar ${dest}/${base_jar}
     # Otherwise assume this jar is provided by cdh in /var/lib/hadoop/client.
     # Symlink it into our new extension from here.
     else
diff --git a/modules/druid/manifests/cdh/hadoop/dependencies.pp 
b/modules/druid/manifests/cdh/hadoop/dependencies.pp
index d88bf93..451a78a 100644
--- a/modules/druid/manifests/cdh/hadoop/dependencies.pp
+++ b/modules/druid/manifests/cdh/hadoop/dependencies.pp
@@ -28,11 +28,18 @@
         group  => 'root',
     }
 
+    $source_dir = "/usr/share/druid/extensions/druid-hdfs-storage"
+    $dest_dir   = "/usr/share/druid/extensions/druid-hdfs-storage-cdh"
+    $hadoop_dir = "/usr/lib/hadoop/client"
     # Run the druid-hdfs-storage-cdh-link to create a
     # new extension using CDH jars.
     exec { 'create-druid-hdfs-storaage-cdh-extension':
-        command => '/usr/local/bin/druid-hdfs-storage-cdh-link',
-        creates => '/usr/share/druid/extensions/druid-hdfs-storage-cdh',
+        command => "/usr/local/bin/druid-hdfs-storage-cdh-link ${source_dir} 
${dest_dir} ${hadoop_dir}",
+        # This command will be run if the 
druid-hdfs-storage-cdh/druid-hdfs-storage.jar
+        # symlink target does not exist.  This symlinks to a versioned jar in 
druid-hdfs-storage/.
+        # During a druid upgrade, the version name of this jar will change, 
causing the symlink
+        # to break, which in turn will this puppet exec.
+        unless  => '/usr/bin/test -e $(/usr/bin/realpath 
${dest_dir}/druid-hdfs-storage.jar)'
         require => File['/usr/local/bin/druid-hdfs-storage-cdh-link'],
     }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/355469
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic304fbce899a9d51fe35959fac191822ac59229c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to