moved lockPartition to utils.LockPartition