Skip to content

Commit 76c78d0

Browse files
authored
Merge pull request #11 from maierbenedikt/production
Delta update preliminary version
2 parents 70875ac + 80b6291 commit 76c78d0

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

bin/dynamod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
HOURS_PER_LOGFILE=24
77
DETOX_INTERVAL=6
88
DEALER_INTERVAL=1
9-
INVENTORY_FULL_UPDATE_INTERVAL=6
9+
INVENTORY_FULL_UPDATE_INTERVAL=12
1010
NUM_CRASHES=0
1111

1212
while [ $# -gt 0 ]
@@ -90,13 +90,13 @@ do
9090
then
9191
echo "Performing the full update of inventory"
9292
$DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site @disk
93-
# $DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_DE_KIT_MSS T1_ES_PIC_MSS T1_FR_CCIN2P3_MSS
94-
# $DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_IT_CNAF_MSS T1_RU_JINR_MSS T1_UK_RAL_MSS
95-
# $DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_US_FNAL_MSS
96-
# $DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T0_CH_CERN_MSS
97-
# else
98-
# echo "Updating the inventory"
99-
# $DYNAMO_BASE/bin/execlib common/inventory.py update
93+
$DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_DE_KIT_MSS T1_ES_PIC_MSS T1_FR_CCIN2P3_MSS
94+
$DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_IT_CNAF_MSS T1_RU_JINR_MSS T1_UK_RAL_MSS
95+
$DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T1_US_FNAL_MSS
96+
$DYNAMO_BASE/bin/execlib common/inventory.py updatefull --site T0_CH_CERN_MSS
97+
else
98+
echo "Updating the inventory"
99+
$DYNAMO_BASE/bin/execlib common/inventory.py update
100100
fi
101101

102102
IHOUR=$(($IHOUR+1))

lib/common/interface/mysqlstore.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,17 @@ def _do_update_blockreplicas(self, replica_list): #override
12371237

12381238
sites = list(set([r.site for r in replica_list])) # list of sites
12391239
datasets = list(set([r.block.dataset for r in replica_list])) # list of datasets
1240-
groups = list(set([r.block.group for r in replica_list])) # list of groups
1240+
# Load all groups - otherwise it won't pass obj.name in the make_map function if group == None.
1241+
# This must be appended separately in make_group_map
1242+
groups = []
1243+
for name, olname in self._mysql.xquery('SELECT `name`, `olevel` FROM `groups`'):
1244+
if olname == 'Dataset':
1245+
olevel = Dataset
1246+
else:
1247+
olevel = Block
1248+
1249+
group = Group(name, olevel)
1250+
groups.append(group)
12411251

12421252
site_id_map = {}
12431253
self._make_site_map(sites, site_id_map = site_id_map)
@@ -1246,6 +1256,7 @@ def _do_update_blockreplicas(self, replica_list): #override
12461256
dataset_id_map = {}
12471257
self._make_dataset_map(datasets, dataset_id_map = dataset_id_map)
12481258

1259+
block_name_to_id = {}
12491260
for dataset in datasets:
12501261
for block_id, block_name in self._mysql.xquery('SELECT `id`, `name` FROM `blocks` WHERE `dataset_id` = %s', dataset_id_map[dataset]):
12511262
block_name_to_id[Block.translate_name(block_name)] = block_id

0 commit comments

Comments
 (0)