- pool = new IdPoolBuilder(pool).setIdEntries(idEntries)
- .setAvailableIdsHolder(availableIds.build()).setReleasedIdsHolder(releasedIds.build()).build();
- MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, idPoolInstanceIdentifier, pool);
- updateChildPool(pool.getParentPoolName(), localPoolName);
+ LOG.debug("The availablelIds are {}", availableIds.build());
+ localPool = new IdPoolBuilder(localPool).setAvailableIdsHolder(availableIds.build())
+ .setReleasedIdsHolder(releasedIds.build()).build();
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, localIdPoolInstanceIdentifier, localPool);
+ updateChildPool(localPool.getParentPoolName(), localPoolName);
+ //Updating id entries in the parent pool. This will be used for restart scenario
+ IdUtils.lockPool(lockManager, parentPoolName);
+ try {
+ parentIdPool = getIdPool(parentIdPoolInstanceIdentifier);
+ IdPool parentPool = new IdPoolBuilder(parentIdPool).setIdEntries(idEntries).build();
+ MDSALUtil.syncWrite(broker, LogicalDatastoreType.CONFIGURATION, parentIdPoolInstanceIdentifier, parentPool);
+ } catch (Exception ex) {
+ LOG.error("Saving of Id entries to parent pool {} failed due to {}", parentPoolName, ex);
+ } finally {
+ IdUtils.unlockPool(lockManager, parentPoolName);
+ }