rucio 37.5.0__py3-none-any.whl → 37.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rucio might be problematic. Click here for more details.
- rucio/cli/bin_legacy/rucio.py +41 -22
- rucio/cli/bin_legacy/rucio_admin.py +1 -1
- rucio/cli/did.py +2 -2
- rucio/cli/rse.py +2 -3
- rucio/cli/rule.py +9 -5
- rucio/cli/subscription.py +1 -1
- rucio/client/baseclient.py +9 -4
- rucio/client/didclient.py +16 -16
- rucio/client/downloadclient.py +16 -15
- rucio/client/exportclient.py +45 -4
- rucio/client/lockclient.py +3 -3
- rucio/client/pingclient.py +35 -4
- rucio/client/replicaclient.py +2 -2
- rucio/client/touchclient.py +3 -2
- rucio/client/uploadclient.py +728 -183
- rucio/common/cache.py +1 -2
- rucio/common/client.py +4 -30
- rucio/common/config.py +27 -3
- rucio/common/constants.py +5 -1
- rucio/common/didtype.py +2 -2
- rucio/common/dumper/__init__.py +1 -1
- rucio/common/pcache.py +20 -25
- rucio/common/plugins.py +12 -19
- rucio/common/policy.py +3 -2
- rucio/common/schema/__init__.py +11 -8
- rucio/common/types.py +7 -5
- rucio/common/utils.py +1 -1
- rucio/core/account.py +2 -1
- rucio/core/account_limit.py +3 -2
- rucio/core/authentication.py +1 -1
- rucio/core/credential.py +1 -1
- rucio/core/did.py +62 -61
- rucio/core/did_meta_plugins/__init__.py +10 -10
- rucio/core/did_meta_plugins/did_column_meta.py +9 -9
- rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
- rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +9 -9
- rucio/core/did_meta_plugins/postgres_meta.py +7 -7
- rucio/core/dirac.py +3 -2
- rucio/core/distance.py +2 -1
- rucio/core/exporter.py +3 -2
- rucio/core/importer.py +5 -5
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +7 -7
- rucio/core/meta_conventions.py +2 -2
- rucio/core/monitor.py +1 -1
- rucio/core/naming_convention.py +1 -1
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +2 -2
- rucio/core/permission/__init__.py +9 -6
- rucio/core/permission/generic.py +2 -2
- rucio/core/permission/generic_multi_vo.py +2 -2
- rucio/core/replica.py +22 -22
- rucio/core/request.py +2 -2
- rucio/core/rse.py +7 -7
- rucio/core/rule.py +38 -38
- rucio/core/rule_grouping.py +2 -3
- rucio/core/scope.py +1 -1
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +2 -2
- rucio/core/vo.py +2 -1
- rucio/daemons/atropos/atropos.py +2 -1
- rucio/daemons/auditor/__init__.py +1 -1
- rucio/daemons/automatix/automatix.py +5 -5
- rucio/daemons/badreplicas/minos.py +12 -5
- rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
- rucio/daemons/badreplicas/necromancer.py +9 -3
- rucio/daemons/bb8/bb8.py +2 -1
- rucio/daemons/bb8/common.py +1 -1
- rucio/daemons/bb8/nuclei_background_rebalance.py +3 -3
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +1 -1
- rucio/daemons/conveyor/common.py +3 -3
- rucio/daemons/conveyor/finisher.py +13 -4
- rucio/daemons/conveyor/poller.py +5 -2
- rucio/daemons/conveyor/receiver.py +1 -1
- rucio/daemons/conveyor/submitter.py +2 -1
- rucio/daemons/follower/follower.py +1 -1
- rucio/daemons/hermes/hermes.py +29 -8
- rucio/daemons/judge/cleaner.py +2 -2
- rucio/daemons/judge/evaluator.py +7 -7
- rucio/daemons/judge/injector.py +2 -2
- rucio/daemons/judge/repairer.py +2 -2
- rucio/daemons/reaper/dark_reaper.py +5 -4
- rucio/daemons/reaper/reaper.py +7 -7
- rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +4 -4
- rucio/daemons/storage/consistency/actions.py +3 -3
- rucio/daemons/tracer/kronos.py +3 -2
- rucio/daemons/transmogrifier/transmogrifier.py +71 -69
- rucio/daemons/undertaker/undertaker.py +8 -7
- rucio/db/sqla/constants.py +4 -3
- rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
- rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
- rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
- rucio/db/sqla/models.py +3 -3
- rucio/db/sqla/session.py +7 -7
- rucio/db/sqla/util.py +3 -2
- rucio/gateway/account.py +77 -101
- rucio/gateway/account_limit.py +90 -116
- rucio/gateway/authentication.py +9 -8
- rucio/gateway/config.py +11 -10
- rucio/gateway/credential.py +2 -1
- rucio/gateway/did.py +58 -58
- rucio/gateway/dirac.py +3 -2
- rucio/gateway/exporter.py +2 -1
- rucio/gateway/heartbeat.py +3 -2
- rucio/gateway/identity.py +4 -3
- rucio/gateway/importer.py +2 -1
- rucio/gateway/lifetime_exception.py +5 -4
- rucio/gateway/lock.py +6 -5
- rucio/gateway/meta_conventions.py +3 -2
- rucio/gateway/permission.py +2 -1
- rucio/gateway/quarantined_replica.py +2 -1
- rucio/gateway/replica.py +20 -20
- rucio/gateway/request.py +10 -10
- rucio/gateway/rse.py +27 -26
- rucio/gateway/rule.py +12 -11
- rucio/gateway/scope.py +4 -3
- rucio/gateway/subscription.py +7 -6
- rucio/gateway/vo.py +5 -4
- rucio/rse/__init__.py +7 -6
- rucio/rse/protocols/ngarc.py +2 -2
- rucio/rse/protocols/srm.py +1 -1
- rucio/rse/protocols/webdav.py +8 -1
- rucio/rse/rsemanager.py +5 -4
- rucio/rse/translation.py +2 -2
- rucio/tests/common.py +6 -5
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accountlimits.py +5 -5
- rucio/web/rest/flaskapi/v1/accounts.py +20 -20
- rucio/web/rest/flaskapi/v1/archives.py +4 -3
- rucio/web/rest/flaskapi/v1/common.py +5 -4
- rucio/web/rest/flaskapi/v1/dids.py +382 -331
- rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
- rucio/web/rest/flaskapi/v1/locks.py +13 -13
- rucio/web/rest/flaskapi/v1/main.py +1 -0
- rucio/web/rest/flaskapi/v1/redirect.py +2 -2
- rucio/web/rest/flaskapi/v1/replicas.py +16 -16
- rucio/web/rest/flaskapi/v1/requests.py +16 -16
- rucio/web/rest/flaskapi/v1/subscriptions.py +7 -7
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-account +8 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-rse +8 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-auditor +1 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-throttler +7 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-follower +1 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-cleaner +9 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-necromancer +7 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-replica-recoverer +31 -9
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-undertaker +8 -2
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/METADATA +1 -1
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/RECORD +202 -202
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/requirements.server.txt +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/WHEEL +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/top_level.txt +0 -0
rucio/core/rse.py
CHANGED
|
@@ -29,7 +29,7 @@ from rucio.common import exception, types, utils
|
|
|
29
29
|
from rucio.common.cache import MemcacheRegion
|
|
30
30
|
from rucio.common.checksum import CHECKSUM_KEY, GLOBALLY_SUPPORTED_CHECKSUMS
|
|
31
31
|
from rucio.common.config import get_lfn2pfn_algorithm_default
|
|
32
|
-
from rucio.common.constants import RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS, RSE_ATTRS_BOOL, RSE_ATTRS_STR, SUPPORTED_SIGN_URL_SERVICES_LITERAL, RseAttr
|
|
32
|
+
from rucio.common.constants import DEFAULT_VO, RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS, RSE_ATTRS_BOOL, RSE_ATTRS_STR, SUPPORTED_SIGN_URL_SERVICES_LITERAL, RseAttr
|
|
33
33
|
from rucio.common.utils import Availability
|
|
34
34
|
from rucio.core.rse_counter import add_counter, get_counter
|
|
35
35
|
from rucio.db.sqla import models
|
|
@@ -415,7 +415,7 @@ def _group_query_result_by_rse_id(
|
|
|
415
415
|
@transactional_session
|
|
416
416
|
def add_rse(
|
|
417
417
|
rse: str,
|
|
418
|
-
vo: str =
|
|
418
|
+
vo: str = DEFAULT_VO,
|
|
419
419
|
deterministic: bool = True,
|
|
420
420
|
volatile: bool = False,
|
|
421
421
|
city: Optional[str] = None,
|
|
@@ -497,7 +497,7 @@ def add_rse(
|
|
|
497
497
|
@read_session
|
|
498
498
|
def rse_exists(
|
|
499
499
|
rse: str,
|
|
500
|
-
vo: str =
|
|
500
|
+
vo: str = DEFAULT_VO,
|
|
501
501
|
include_deleted: bool = False,
|
|
502
502
|
*,
|
|
503
503
|
session: "Session"
|
|
@@ -662,7 +662,7 @@ def get_rse(
|
|
|
662
662
|
@read_session
|
|
663
663
|
def get_rse_id(
|
|
664
664
|
rse: str,
|
|
665
|
-
vo: str =
|
|
665
|
+
vo: str = DEFAULT_VO,
|
|
666
666
|
include_deleted: bool = True,
|
|
667
667
|
*,
|
|
668
668
|
session: "Session"
|
|
@@ -680,7 +680,7 @@ def get_rse_id(
|
|
|
680
680
|
"""
|
|
681
681
|
|
|
682
682
|
if include_deleted:
|
|
683
|
-
if vo !=
|
|
683
|
+
if vo != DEFAULT_VO:
|
|
684
684
|
cache_key = 'rse-id_{}@{}'.format(rse, vo).replace(' ', '.')
|
|
685
685
|
else:
|
|
686
686
|
cache_key = 'rse-id_{}'.format(rse).replace(' ', '.')
|
|
@@ -1035,7 +1035,7 @@ def get_rses_with_attribute(
|
|
|
1035
1035
|
def get_rses_with_attribute_value(
|
|
1036
1036
|
key: str,
|
|
1037
1037
|
value: Union[bool, str],
|
|
1038
|
-
vo: str =
|
|
1038
|
+
vo: str = DEFAULT_VO,
|
|
1039
1039
|
*,
|
|
1040
1040
|
session: "Session"
|
|
1041
1041
|
) -> list[dict[str, str]]:
|
|
@@ -1048,7 +1048,7 @@ def get_rses_with_attribute_value(
|
|
|
1048
1048
|
|
|
1049
1049
|
:returns: List of rse dictionaries with the rse_id and rse_name
|
|
1050
1050
|
"""
|
|
1051
|
-
if vo !=
|
|
1051
|
+
if vo != DEFAULT_VO:
|
|
1052
1052
|
cache_key = 'av-%s-%s@%s' % (key, value, vo)
|
|
1053
1053
|
else:
|
|
1054
1054
|
cache_key = 'av-%s-%s' % (key, value)
|
rucio/core/rule.py
CHANGED
|
@@ -37,7 +37,7 @@ import rucio.core.lock # import get_replica_locks, get_files_and_replica_locks_
|
|
|
37
37
|
import rucio.core.replica # import get_and_lock_file_replicas, get_and_lock_file_replicas_for_dataset
|
|
38
38
|
from rucio.common.cache import MemcacheRegion
|
|
39
39
|
from rucio.common.config import config_get
|
|
40
|
-
from rucio.common.constants import RseAttr
|
|
40
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
41
41
|
from rucio.common.exception import (
|
|
42
42
|
DataIdentifierNotFound,
|
|
43
43
|
DuplicateRule,
|
|
@@ -191,7 +191,7 @@ def add_rule(
|
|
|
191
191
|
logger: LoggerFunction = logging.log
|
|
192
192
|
) -> list[str]:
|
|
193
193
|
"""
|
|
194
|
-
Adds a replication rule for every
|
|
194
|
+
Adds a replication rule for every DID in DIDs
|
|
195
195
|
|
|
196
196
|
:param dids: List of data identifiers.
|
|
197
197
|
:param account: Account issuing the rule.
|
|
@@ -277,7 +277,7 @@ def add_rule(
|
|
|
277
277
|
notify_value = {'Y': RuleNotification.YES, 'C': RuleNotification.CLOSE, 'P': RuleNotification.PROGRESS}.get(notify or '', RuleNotification.NO)
|
|
278
278
|
|
|
279
279
|
for elem in dids:
|
|
280
|
-
# 3. Get the
|
|
280
|
+
# 3. Get the DID
|
|
281
281
|
with METRICS.timer('add_rule.get_did'):
|
|
282
282
|
try:
|
|
283
283
|
stmt = select(
|
|
@@ -292,7 +292,7 @@ def add_rule(
|
|
|
292
292
|
except TypeError as error:
|
|
293
293
|
raise InvalidObject(error.args) from error # https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/raise-missing-from.html
|
|
294
294
|
|
|
295
|
-
# 3.1 If the
|
|
295
|
+
# 3.1 If the DID is a constituent, relay the rule to the archive
|
|
296
296
|
if did.did_type == DIDType.FILE and did.constituent:
|
|
297
297
|
# Check if a single replica of this DID exists; Do not put rule on file if there are only replicas on TAPE
|
|
298
298
|
stmt = select(
|
|
@@ -407,7 +407,7 @@ def add_rule(
|
|
|
407
407
|
logger(logging.DEBUG, "Forced injection of rule %s", str(new_rule.id))
|
|
408
408
|
|
|
409
409
|
if asynchronous or delay_injection:
|
|
410
|
-
# TODO: asynchronous mode only available for closed
|
|
410
|
+
# TODO: asynchronous mode only available for closed DIDs (on the whole tree?)
|
|
411
411
|
new_rule.state = RuleState.INJECT
|
|
412
412
|
logger(logging.DEBUG, "Created rule %s for injection", str(new_rule.id))
|
|
413
413
|
if delay_injection:
|
|
@@ -485,7 +485,7 @@ def add_rules(
|
|
|
485
485
|
logger: LoggerFunction = logging.log
|
|
486
486
|
) -> dict[tuple[InternalScope, str], list[str]]:
|
|
487
487
|
"""
|
|
488
|
-
Adds a list of replication rules to every
|
|
488
|
+
Adds a list of replication rules to every DID in DIDs
|
|
489
489
|
|
|
490
490
|
:params dids: List of data identifiers.
|
|
491
491
|
:param rules: List of dictionaries defining replication rules.
|
|
@@ -521,7 +521,7 @@ def add_rules(
|
|
|
521
521
|
all_source_rses = list(set([rse['id'] for rse in all_source_rses]))
|
|
522
522
|
|
|
523
523
|
for elem in dids:
|
|
524
|
-
# 2. Get the
|
|
524
|
+
# 2. Get the DID
|
|
525
525
|
with METRICS.timer('add_rules.get_did'):
|
|
526
526
|
try:
|
|
527
527
|
stmt = select(
|
|
@@ -536,7 +536,7 @@ def add_rules(
|
|
|
536
536
|
except TypeError as error:
|
|
537
537
|
raise InvalidObject(error.args) from error
|
|
538
538
|
|
|
539
|
-
# 2.1 If the
|
|
539
|
+
# 2.1 If the DID is a constituent, relay the rule to the archive
|
|
540
540
|
if did.did_type == DIDType.FILE and did.constituent: # Check if a single replica of this DID exists
|
|
541
541
|
stmt = select(
|
|
542
542
|
func.count()
|
|
@@ -584,7 +584,7 @@ def add_rules(
|
|
|
584
584
|
|
|
585
585
|
rule_ids[(elem['scope'], elem['name'])] = []
|
|
586
586
|
|
|
587
|
-
# 3. Resolve the
|
|
587
|
+
# 3. Resolve the DID into its contents
|
|
588
588
|
with METRICS.timer('add_rules.resolve_dids_to_locks_replicas'):
|
|
589
589
|
# Get all Replicas, not only the ones interesting for the rse_expression
|
|
590
590
|
datasetfiles, locks, replicas, source_replicas = __resolve_did_to_locks_and_replicas(did=did,
|
|
@@ -828,7 +828,7 @@ def inject_rule(
|
|
|
828
828
|
dids = [{'scope': dataset['scope'], 'name': dataset['name']} for dataset in rucio.core.did.list_child_datasets(scope=rule.scope, name=rule.name, session=session)]
|
|
829
829
|
# Remove duplicates from the list of dictionaries
|
|
830
830
|
dids = [dict(t) for t in {tuple(d.items()) for d in dids}]
|
|
831
|
-
# Remove
|
|
831
|
+
# Remove DIDs which already have a similar rule
|
|
832
832
|
stmt = select(
|
|
833
833
|
models.ReplicationRule.id
|
|
834
834
|
).where(
|
|
@@ -881,7 +881,7 @@ def inject_rule(
|
|
|
881
881
|
with METRICS.timer('inject_rule.create_rse_selector'):
|
|
882
882
|
rseselector = RSESelector(account=rule['account'], rses=rses, weight=rule.weight, copies=rule.copies, ignore_account_limit=rule.ignore_account_limit, session=session)
|
|
883
883
|
|
|
884
|
-
# 3. Get the
|
|
884
|
+
# 3. Get the DID
|
|
885
885
|
with METRICS.timer('inject_rule.get_did'):
|
|
886
886
|
try:
|
|
887
887
|
stmt = select(
|
|
@@ -1104,7 +1104,7 @@ def list_associated_rules_for_file(
|
|
|
1104
1104
|
:param session: The database session in use.
|
|
1105
1105
|
:raises: RucioException
|
|
1106
1106
|
"""
|
|
1107
|
-
rucio.core.did.get_did(scope=scope, name=name, session=session) # Check if the
|
|
1107
|
+
rucio.core.did.get_did(scope=scope, name=name, session=session) # Check if the DID actually exists
|
|
1108
1108
|
stmt = select(
|
|
1109
1109
|
models.ReplicationRule,
|
|
1110
1110
|
models.DataIdentifier.bytes
|
|
@@ -1364,7 +1364,7 @@ def repair_rule(
|
|
|
1364
1364
|
rule.locks_stuck_cnt = count.state_counter
|
|
1365
1365
|
logger(logging.DEBUG, "Finished resetting counters for rule %s [%d/%d/%d]", str(rule.id), rule.locks_ok_cnt, rule.locks_replicating_cnt, rule.locks_stuck_cnt)
|
|
1366
1366
|
|
|
1367
|
-
# Get the
|
|
1367
|
+
# Get the DID
|
|
1368
1368
|
stmt = select(
|
|
1369
1369
|
models.DataIdentifier
|
|
1370
1370
|
).where(
|
|
@@ -1387,7 +1387,7 @@ def repair_rule(
|
|
|
1387
1387
|
hard_repair = True
|
|
1388
1388
|
logger(logging.DEBUG, 'Repairing rule %s in HARD mode', str(rule.id))
|
|
1389
1389
|
|
|
1390
|
-
# Resolve the
|
|
1390
|
+
# Resolve the DID to its contents
|
|
1391
1391
|
datasetfiles, locks, replicas, source_replicas = __resolve_did_to_locks_and_replicas(did=did,
|
|
1392
1392
|
nowait=True,
|
|
1393
1393
|
restrict_rses=[rse['id'] for rse in rses],
|
|
@@ -2060,10 +2060,10 @@ def re_evaluate_did(
|
|
|
2060
2060
|
logger: LoggerFunction = logging.log
|
|
2061
2061
|
) -> None:
|
|
2062
2062
|
"""
|
|
2063
|
-
Re-Evaluates a
|
|
2063
|
+
Re-Evaluates a DID.
|
|
2064
2064
|
|
|
2065
|
-
:param scope: The scope of the
|
|
2066
|
-
:param name: The name of the
|
|
2065
|
+
:param scope: The scope of the DID to be re-evaluated.
|
|
2066
|
+
:param name: The name of the DID to be re-evaluated.
|
|
2067
2067
|
:param rule_evaluation_action: The Rule evaluation action.
|
|
2068
2068
|
:param session: The database session in use.
|
|
2069
2069
|
:param logger: Optional decorated logger that can be passed from the calling daemons or servers.
|
|
@@ -2086,7 +2086,7 @@ def re_evaluate_did(
|
|
|
2086
2086
|
else:
|
|
2087
2087
|
__evaluate_did_detach(did, session=session, logger=logger)
|
|
2088
2088
|
|
|
2089
|
-
# Update size and length of
|
|
2089
|
+
# Update size and length of DID
|
|
2090
2090
|
if session.bind.dialect.name == 'oracle':
|
|
2091
2091
|
stmt = select(
|
|
2092
2092
|
func.sum(models.DataIdentifierAssociation.bytes),
|
|
@@ -2118,12 +2118,12 @@ def get_updated_dids(
|
|
|
2118
2118
|
session: "Session"
|
|
2119
2119
|
) -> list[tuple[str, InternalScope, str, DIDReEvaluation]]:
|
|
2120
2120
|
"""
|
|
2121
|
-
Get updated
|
|
2121
|
+
Get updated DIDs.
|
|
2122
2122
|
|
|
2123
2123
|
:param total_workers: Number of total workers.
|
|
2124
2124
|
:param worker_number: id of the executing worker.
|
|
2125
|
-
:param limit: Maximum number of
|
|
2126
|
-
:param blocked_dids: Blocked
|
|
2125
|
+
:param limit: Maximum number of DIDs to return.
|
|
2126
|
+
:param blocked_dids: Blocked DIDs to filter.
|
|
2127
2127
|
:param session: Database session in use.
|
|
2128
2128
|
"""
|
|
2129
2129
|
blocked_dids = blocked_dids or []
|
|
@@ -2135,7 +2135,7 @@ def get_updated_dids(
|
|
|
2135
2135
|
)
|
|
2136
2136
|
stmt = filter_thread_work(session=session, query=stmt, total_threads=total_workers, thread_id=worker_number, hash_variable='name')
|
|
2137
2137
|
|
|
2138
|
-
# Remove blocked
|
|
2138
|
+
# Remove blocked DIDs from query, but only do the first 30 ones, not to overload the query
|
|
2139
2139
|
if blocked_dids:
|
|
2140
2140
|
chunk = list(chunks(blocked_dids, 30))[0]
|
|
2141
2141
|
stmt = stmt.where(tuple_(models.UpdatedDID.scope, models.UpdatedDID.name).notin_(chunk))
|
|
@@ -2510,7 +2510,7 @@ def update_rules_for_lost_replica(
|
|
|
2510
2510
|
'name': name,
|
|
2511
2511
|
'dataset_name': dts['name'],
|
|
2512
2512
|
'dataset_scope': dts['scope'].external}
|
|
2513
|
-
if scope.vo !=
|
|
2513
|
+
if scope.vo != DEFAULT_VO:
|
|
2514
2514
|
message['vo'] = scope.vo
|
|
2515
2515
|
|
|
2516
2516
|
add_message('LOST', message, session=session)
|
|
@@ -2675,7 +2675,7 @@ def generate_rule_notifications(
|
|
|
2675
2675
|
payload = {'scope': rule.scope.external,
|
|
2676
2676
|
'name': rule.name,
|
|
2677
2677
|
'rule_id': rule.id}
|
|
2678
|
-
if rule.scope.vo !=
|
|
2678
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2679
2679
|
payload['vo'] = rule.scope.vo
|
|
2680
2680
|
|
|
2681
2681
|
add_message(event_type='RULE_OK', payload=payload, session=session)
|
|
@@ -2687,7 +2687,7 @@ def generate_rule_notifications(
|
|
|
2687
2687
|
payload = {'scope': rule.scope.external,
|
|
2688
2688
|
'name': rule.name,
|
|
2689
2689
|
'rule_id': rule.id}
|
|
2690
|
-
if rule.scope.vo !=
|
|
2690
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2691
2691
|
payload['vo'] = rule.scope.vo
|
|
2692
2692
|
|
|
2693
2693
|
add_message(event_type='RULE_OK', payload=payload, session=session)
|
|
@@ -2697,7 +2697,7 @@ def generate_rule_notifications(
|
|
|
2697
2697
|
'name': rule.name,
|
|
2698
2698
|
'rule_id': rule.id,
|
|
2699
2699
|
'progress': __progress_class(rule.locks_replicating_cnt, total_locks)}
|
|
2700
|
-
if rule.scope.vo !=
|
|
2700
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2701
2701
|
payload['vo'] = rule.scope.vo
|
|
2702
2702
|
|
|
2703
2703
|
add_message(event_type='RULE_PROGRESS', payload=payload, session=session)
|
|
@@ -2721,7 +2721,7 @@ def generate_rule_notifications(
|
|
|
2721
2721
|
'rse': get_rse_name(rse_id=dataset_lock.rse_id, session=session),
|
|
2722
2722
|
'rse_id': dataset_lock.rse_id,
|
|
2723
2723
|
'rule_id': rule.id}
|
|
2724
|
-
if dataset_lock.scope.vo !=
|
|
2724
|
+
if dataset_lock.scope.vo != DEFAULT_VO:
|
|
2725
2725
|
payload['vo'] = dataset_lock.scope.vo
|
|
2726
2726
|
|
|
2727
2727
|
add_message(event_type='DATASETLOCK_OK', payload=payload, session=session)
|
|
@@ -2745,7 +2745,7 @@ def generate_rule_notifications(
|
|
|
2745
2745
|
'rse': get_rse_name(rse_id=dataset_lock.rse_id, session=session),
|
|
2746
2746
|
'rse_id': dataset_lock.rse_id,
|
|
2747
2747
|
'rule_id': rule.id}
|
|
2748
|
-
if dataset_lock.scope.vo !=
|
|
2748
|
+
if dataset_lock.scope.vo != DEFAULT_VO:
|
|
2749
2749
|
payload['vo'] = dataset_lock.scope.vo
|
|
2750
2750
|
|
|
2751
2751
|
add_message(event_type='DATASETLOCK_OK', payload=payload, session=session)
|
|
@@ -2763,7 +2763,7 @@ def generate_rule_notifications(
|
|
|
2763
2763
|
'name': rule.name,
|
|
2764
2764
|
'rule_id': rule.id,
|
|
2765
2765
|
'progress': __progress_class(rule.locks_replicating_cnt, total_locks)}
|
|
2766
|
-
if rule.scope.vo !=
|
|
2766
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2767
2767
|
payload['vo'] = rule.scope.vo
|
|
2768
2768
|
|
|
2769
2769
|
add_message(event_type='RULE_PROGRESS', payload=payload, session=session)
|
|
@@ -3403,9 +3403,9 @@ def __evaluate_did_detach(
|
|
|
3403
3403
|
logger: LoggerFunction = logging.log
|
|
3404
3404
|
) -> None:
|
|
3405
3405
|
"""
|
|
3406
|
-
Evaluate a parent
|
|
3406
|
+
Evaluate a parent DID which has children removed.
|
|
3407
3407
|
|
|
3408
|
-
:param eval_did: The
|
|
3408
|
+
:param eval_did: The DID object in use.
|
|
3409
3409
|
:param session: The database session in use.
|
|
3410
3410
|
:param logger: Optional decorated logger that can be passed from the calling daemons or servers.
|
|
3411
3411
|
"""
|
|
@@ -3563,9 +3563,9 @@ def __evaluate_did_attach(
|
|
|
3563
3563
|
logger: LoggerFunction = logging.log
|
|
3564
3564
|
) -> None:
|
|
3565
3565
|
"""
|
|
3566
|
-
Evaluate a parent
|
|
3566
|
+
Evaluate a parent DID which has new children
|
|
3567
3567
|
|
|
3568
|
-
:param eval_did: The
|
|
3568
|
+
:param eval_did: The DID object in use.
|
|
3569
3569
|
:param session: The database session in use.
|
|
3570
3570
|
:param logger: Optional decorated logger that can be passed from the calling daemons or servers.
|
|
3571
3571
|
:raises: ReplicationRuleCreationTemporaryFailed
|
|
@@ -3793,7 +3793,7 @@ def __evaluate_did_attach(
|
|
|
3793
3793
|
# Insert rule history
|
|
3794
3794
|
insert_rule_history(rule=rule, recent=True, longterm=False, session=session)
|
|
3795
3795
|
|
|
3796
|
-
#
|
|
3796
|
+
# Unflag the DIDs
|
|
3797
3797
|
with METRICS.timer('evaluate_did_attach.update_did'):
|
|
3798
3798
|
for did in new_child_dids:
|
|
3799
3799
|
did.rule_evaluation = None
|
|
@@ -3815,9 +3815,9 @@ def __resolve_did_to_locks_and_replicas(
|
|
|
3815
3815
|
dict[tuple[str, str], models.RSEFileAssociation],
|
|
3816
3816
|
dict[tuple[str, str], str]]:
|
|
3817
3817
|
"""
|
|
3818
|
-
Resolves a
|
|
3818
|
+
Resolves a DID to its constituent children and reads the locks and replicas of all the constituent files.
|
|
3819
3819
|
|
|
3820
|
-
:param did: The db object of the
|
|
3820
|
+
:param did: The db object of the DID the rule is applied on.
|
|
3821
3821
|
:param nowait: Nowait parameter for the FOR UPDATE statement.
|
|
3822
3822
|
:param restrict_rses: Possible rses of the rule, so only these replica/locks should be considered.
|
|
3823
3823
|
:param source_rses: Source rses for this rule. These replicas are not row-locked.
|
|
@@ -3922,7 +3922,7 @@ def __resolve_dids_to_locks_and_replicas(
|
|
|
3922
3922
|
dict[tuple[str, str], models.RSEFileAssociation],
|
|
3923
3923
|
dict[tuple[str, str], str]]:
|
|
3924
3924
|
"""
|
|
3925
|
-
Resolves a list of
|
|
3925
|
+
Resolves a list of DIDs to its constituent children and reads the locks and replicas of all the constituent files.
|
|
3926
3926
|
|
|
3927
3927
|
:param dids: The list of DataIdentifierAssociation objects.
|
|
3928
3928
|
:param nowait: Nowait parameter for the FOR UPDATE statement.
|
|
@@ -3940,7 +3940,7 @@ def __resolve_dids_to_locks_and_replicas(
|
|
|
3940
3940
|
restrict_rses = restrict_rses or []
|
|
3941
3941
|
|
|
3942
3942
|
if dids[0].child_type == DIDType.FILE:
|
|
3943
|
-
# All the
|
|
3943
|
+
# All the DIDs will be files!
|
|
3944
3944
|
# Prepare the datasetfiles
|
|
3945
3945
|
files = []
|
|
3946
3946
|
for did in dids:
|
rucio/core/rule_grouping.py
CHANGED
|
@@ -1317,9 +1317,9 @@ def __set_replica_unavailable(replica, *, session: "Session"):
|
|
|
1317
1317
|
@transactional_session
|
|
1318
1318
|
def apply_rule(did, rule, rses, source_rses, rseselector, *, session: "Session", logger=logging.log):
|
|
1319
1319
|
"""
|
|
1320
|
-
Apply a replication rule to one
|
|
1320
|
+
Apply a replication rule to one DID.
|
|
1321
1321
|
|
|
1322
|
-
:param did: the
|
|
1322
|
+
:param did: the DID object
|
|
1323
1323
|
:param rule: the rule object
|
|
1324
1324
|
:param rses: target rses_ids
|
|
1325
1325
|
:param source_rses: source rses_ids
|
|
@@ -1616,4 +1616,3 @@ def apply_rule(did, rule, rses, source_rses, rseselector, *, session: "Session",
|
|
|
1616
1616
|
for rse_id in account_counters_files:
|
|
1617
1617
|
account_counter.increase(rse_id=rse_id, account=rule.account, files=account_counters_files[rse_id], bytes_=account_counters_bytes[rse_id], session=session)
|
|
1618
1618
|
session.flush()
|
|
1619
|
-
|
rucio/core/scope.py
CHANGED
rucio/core/trace.py
CHANGED
|
@@ -71,7 +71,7 @@ ROTATING_LOGGER.addHandler(ROTATING_HANDLER)
|
|
|
71
71
|
BROKERS_ALIAS, BROKERS_RESOLVED = [], []
|
|
72
72
|
try:
|
|
73
73
|
BROKERS_ALIAS = config_get_list('trace', 'brokers')
|
|
74
|
-
except:
|
|
74
|
+
except Exception:
|
|
75
75
|
raise Exception('Could not load brokers from configuration')
|
|
76
76
|
|
|
77
77
|
PORT = config_get_int('trace', 'port')
|
|
@@ -285,7 +285,7 @@ for broker in BROKERS_ALIAS:
|
|
|
285
285
|
try:
|
|
286
286
|
addrinfos = socket.getaddrinfo(broker, 0, socket.AF_INET, 0, socket.IPPROTO_TCP)
|
|
287
287
|
BROKERS_RESOLVED = [ai[4][0] for ai in addrinfos]
|
|
288
|
-
except:
|
|
288
|
+
except Exception:
|
|
289
289
|
pass
|
|
290
290
|
|
|
291
291
|
CONNS = []
|
rucio/core/transfer.py
CHANGED
|
@@ -28,7 +28,7 @@ from sqlalchemy import select, update
|
|
|
28
28
|
from sqlalchemy.exc import IntegrityError
|
|
29
29
|
|
|
30
30
|
from rucio.common.config import config_get, config_get_list
|
|
31
|
-
from rucio.common.constants import SUPPORTED_PROTOCOLS, RseAttr, TransferLimitDirection
|
|
31
|
+
from rucio.common.constants import DEFAULT_VO, SUPPORTED_PROTOCOLS, RseAttr, TransferLimitDirection
|
|
32
32
|
from rucio.common.exception import InvalidRSEExpression, RequestNotFound, RSEProtocolNotSupported, RucioException, UnsupportedOperation
|
|
33
33
|
from rucio.common.utils import construct_non_deterministic_pfn, get_transfer_schemas
|
|
34
34
|
from rucio.core import did
|
|
@@ -485,7 +485,7 @@ def set_transfers_state(
|
|
|
485
485
|
'external-host': external_host,
|
|
486
486
|
'queued_at': str(submitted_at),
|
|
487
487
|
'datatype': datatype}
|
|
488
|
-
if rws.scope.vo !=
|
|
488
|
+
if rws.scope.vo != DEFAULT_VO:
|
|
489
489
|
msg['vo'] = rws.scope.vo
|
|
490
490
|
|
|
491
491
|
ds_scope = transfer.rws.attributes.get('ds_scope')
|
rucio/core/vo.py
CHANGED
|
@@ -20,6 +20,7 @@ from sqlalchemy.exc import DatabaseError, IntegrityError, NoResultFound
|
|
|
20
20
|
|
|
21
21
|
from rucio.common import exception
|
|
22
22
|
from rucio.common.config import config_get, config_get_bool
|
|
23
|
+
from rucio.common.constants import DEFAULT_VO
|
|
23
24
|
from rucio.common.types import InternalAccount
|
|
24
25
|
from rucio.db.sqla import models
|
|
25
26
|
from rucio.db.sqla.constants import AccountType, IdentityType
|
|
@@ -88,7 +89,7 @@ def add_vo(vo: str, description: str, email: str, *, session: "Session") -> None
|
|
|
88
89
|
password='password', # noqa: S106
|
|
89
90
|
session=session)
|
|
90
91
|
|
|
91
|
-
for ident in list_identities(account=InternalAccount('super_root', vo=
|
|
92
|
+
for ident in list_identities(account=InternalAccount('super_root', vo=DEFAULT_VO), session=session):
|
|
92
93
|
add_account_identity(identity=ident['identity'], type_=ident['type'], account=new_root, email='', session=session)
|
|
93
94
|
|
|
94
95
|
|
rucio/daemons/atropos/atropos.py
CHANGED
|
@@ -24,6 +24,7 @@ from typing import TYPE_CHECKING
|
|
|
24
24
|
import rucio.core.lifetime_exception
|
|
25
25
|
import rucio.db.sqla.util
|
|
26
26
|
from rucio.common import exception
|
|
27
|
+
from rucio.common.constants import DEFAULT_VO
|
|
27
28
|
from rucio.common.exception import InvalidRSEExpression, RuleNotFound
|
|
28
29
|
from rucio.common.logging import setup_logging
|
|
29
30
|
from rucio.core.did import set_metadata
|
|
@@ -193,7 +194,7 @@ def run_once(
|
|
|
193
194
|
tot_size += summary[rse_id][did].get('bytes', 0)
|
|
194
195
|
vo = get_rse_vo(rse_id=rse_id)
|
|
195
196
|
logger(logging.INFO, 'For RSE %s%s %d datasets will be deleted representing %d files and %d bytes',
|
|
196
|
-
get_rse_name(rse_id=rse_id), '' if vo ==
|
|
197
|
+
get_rse_name(rse_id=rse_id), '' if vo == DEFAULT_VO else ' on VO ' + vo, tot_datasets, tot_files, tot_size)
|
|
197
198
|
|
|
198
199
|
|
|
199
200
|
def run(
|
|
@@ -247,7 +247,7 @@ def check(
|
|
|
247
247
|
results_dir)
|
|
248
248
|
if output:
|
|
249
249
|
process_output(output)
|
|
250
|
-
except:
|
|
250
|
+
except Exception:
|
|
251
251
|
elapsed = (datetime.now() - start).total_seconds() / 60
|
|
252
252
|
logger.error('Check of "%s" failed in %d minutes, %d remaining attempts', rse, elapsed, attempts, exc_info=True)
|
|
253
253
|
success = False
|
|
@@ -31,7 +31,7 @@ from rucio.common import exception
|
|
|
31
31
|
from rucio.common.config import config_get, config_get_bool, config_get_int, config_get_list
|
|
32
32
|
from rucio.common.logging import setup_logging
|
|
33
33
|
from rucio.common.stopwatch import Stopwatch
|
|
34
|
-
from rucio.common.types import InternalScope, LoggerFunction
|
|
34
|
+
from rucio.common.types import FileToUploadDict, InternalScope, LoggerFunction
|
|
35
35
|
from rucio.common.utils import execute, generate_uuid
|
|
36
36
|
from rucio.core.monitor import MetricManager
|
|
37
37
|
from rucio.core.scope import list_scopes
|
|
@@ -214,7 +214,7 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
214
214
|
fnames = []
|
|
215
215
|
lfns = []
|
|
216
216
|
physical_fnames = []
|
|
217
|
-
|
|
217
|
+
items: list[FileToUploadDict] = []
|
|
218
218
|
for _ in range(nbfiles):
|
|
219
219
|
fname = generate_didname(metadata=metadata, dsn=dsn, did_type="file")
|
|
220
220
|
lfns.append(fname)
|
|
@@ -223,7 +223,7 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
223
223
|
physical_fnames.append(physical_fname)
|
|
224
224
|
generate_file(physical_fname, filesize, logger=logger)
|
|
225
225
|
fnames.append(fname)
|
|
226
|
-
file_ = {
|
|
226
|
+
file_: FileToUploadDict = {
|
|
227
227
|
"did_scope": scope,
|
|
228
228
|
"did_name": fname,
|
|
229
229
|
"dataset_scope": scope,
|
|
@@ -235,11 +235,11 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
235
235
|
file_["dataset_meta"] = metadata
|
|
236
236
|
if dataset_lifetime:
|
|
237
237
|
file_["dataset_meta"]["lifetime"] = dataset_lifetime
|
|
238
|
-
|
|
238
|
+
items.append(file_)
|
|
239
239
|
logger(logging.INFO, "Upload %s:%s to %s", scope, dsn, rse)
|
|
240
240
|
try:
|
|
241
241
|
upload_client = UploadClient(client)
|
|
242
|
-
ret = upload_client.upload(
|
|
242
|
+
ret = upload_client.upload(items=items)
|
|
243
243
|
if ret == 0:
|
|
244
244
|
logger(logging.INFO, "%s successfully registered on %s", dsn, rse)
|
|
245
245
|
METRICS.counter(name="addnewdataset.done").inc()
|
|
@@ -24,6 +24,7 @@ from sqlalchemy.exc import DatabaseError
|
|
|
24
24
|
|
|
25
25
|
import rucio.db.sqla.util
|
|
26
26
|
from rucio.common.config import config_get_int
|
|
27
|
+
from rucio.common.constants import DEFAULT_VO
|
|
27
28
|
from rucio.common.exception import DatabaseException, DataIdentifierNotFound, ReplicaNotFound, UnsupportedOperation
|
|
28
29
|
from rucio.common.logging import setup_logging
|
|
29
30
|
from rucio.common.utils import chunks
|
|
@@ -31,7 +32,7 @@ from rucio.core.did import get_metadata
|
|
|
31
32
|
from rucio.core.replica import bulk_add_bad_replicas, bulk_delete_bad_pfns, declare_bad_file_replicas, get_bad_pfns, get_did_from_pfns, get_pfn_to_rse, get_replicas_state, update_replicas_states
|
|
32
33
|
from rucio.core.rse import get_rse_name
|
|
33
34
|
from rucio.daemons.common import run_daemon
|
|
34
|
-
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, BadFilesStatus, BadPFNStatus, ReplicaState
|
|
35
|
+
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, BadFilesStatus, BadPFNStatus, ReplicaState
|
|
35
36
|
from rucio.db.sqla.session import get_session
|
|
36
37
|
|
|
37
38
|
if TYPE_CHECKING:
|
|
@@ -208,7 +209,7 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
208
209
|
dict_rse = __clean_unknown_replicas(pfns, vo, logger)
|
|
209
210
|
for rse_id, pfns_by_scheme in dict_rse.items():
|
|
210
211
|
rse = get_rse_name(rse_id=rse_id, session=None)
|
|
211
|
-
rse_vo_str = rse if vo ==
|
|
212
|
+
rse_vo_str = rse if vo == DEFAULT_VO else '{} on VO {}'.format(rse, vo)
|
|
212
213
|
for scheme, pfns in pfns_by_scheme.items():
|
|
213
214
|
logger(logging.DEBUG, 'Running on RSE %s with %s replicas', rse_vo_str, len(pfns))
|
|
214
215
|
tot_chunk = int(math.ceil(len(pfns) / chunk_size))
|
|
@@ -220,7 +221,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
220
221
|
bulk_delete_bad_pfns(pfns=chunk, session=session)
|
|
221
222
|
session.commit() # pylint: disable=no-member
|
|
222
223
|
except (DatabaseException, DatabaseError) as error:
|
|
223
|
-
if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
224
|
+
if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
225
|
+
or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
|
|
226
|
+
or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
|
|
227
|
+
or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
|
|
224
228
|
logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
|
|
225
229
|
else:
|
|
226
230
|
logger(logging.ERROR, 'Exception', exc_info=True)
|
|
@@ -242,7 +246,7 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
242
246
|
for rse_id in dict_rse:
|
|
243
247
|
replicas = []
|
|
244
248
|
rse = get_rse_name(rse_id=rse_id, session=None)
|
|
245
|
-
rse_vo_str = rse if vo ==
|
|
249
|
+
rse_vo_str = rse if vo == DEFAULT_VO else '{} on VO {}'.format(rse, vo)
|
|
246
250
|
logger(logging.DEBUG, 'Running on RSE %s', rse_vo_str)
|
|
247
251
|
for rse_id, pfns_by_scheme in dict_rse.items():
|
|
248
252
|
for scheme, pfns in pfns_by_scheme.items():
|
|
@@ -273,7 +277,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
273
277
|
__update_temporary_unavailable(chunk=chunk, reason=reason, expires_at=expires_at, account=account, logger=logger)
|
|
274
278
|
session = get_session()
|
|
275
279
|
except (DatabaseException, DatabaseError) as error:
|
|
276
|
-
if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
280
|
+
if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
281
|
+
or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
|
|
282
|
+
or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
|
|
283
|
+
or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
|
|
277
284
|
logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
|
|
278
285
|
else:
|
|
279
286
|
logger(logging.ERROR, 'Exception', exc_info=True)
|
|
@@ -30,7 +30,7 @@ from rucio.common.utils import chunks
|
|
|
30
30
|
from rucio.core.did import get_metadata
|
|
31
31
|
from rucio.core.replica import bulk_delete_bad_replicas, get_replicas_state, list_expired_temporary_unavailable_replicas, update_replicas_states
|
|
32
32
|
from rucio.daemons.common import run_daemon
|
|
33
|
-
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, BadFilesStatus, ReplicaState
|
|
33
|
+
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, BadFilesStatus, ReplicaState
|
|
34
34
|
from rucio.db.sqla.session import get_session
|
|
35
35
|
|
|
36
36
|
if TYPE_CHECKING:
|
|
@@ -127,7 +127,10 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
127
127
|
session.commit() # pylint: disable=no-member
|
|
128
128
|
session = get_session()
|
|
129
129
|
except (DatabaseException, DatabaseError) as error:
|
|
130
|
-
if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
130
|
+
if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
131
|
+
or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
|
|
132
|
+
or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
|
|
133
|
+
or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
|
|
131
134
|
logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
|
|
132
135
|
else:
|
|
133
136
|
logger(logging.ERROR, 'Exception', exc_info=True)
|
|
@@ -33,7 +33,7 @@ from rucio.core.monitor import MetricManager
|
|
|
33
33
|
from rucio.core.replica import get_bad_replicas_backlog, get_replicas_state, list_bad_replicas
|
|
34
34
|
from rucio.core.rule import get_evaluation_backlog, update_rules_for_bad_replica, update_rules_for_lost_replica
|
|
35
35
|
from rucio.daemons.common import HeartbeatHandler, run_daemon
|
|
36
|
-
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, ReplicaState
|
|
36
|
+
from rucio.db.sqla.constants import MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED, ORACLE_DEADLOCK_DETECTED_REGEX, ORACLE_RESOURCE_BUSY_REGEX, PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, ReplicaState
|
|
37
37
|
|
|
38
38
|
if TYPE_CHECKING:
|
|
39
39
|
from types import FrameType
|
|
@@ -136,7 +136,10 @@ def run_once(heartbeat_handler: HeartbeatHandler, bulk: int, **_kwargs) -> bool:
|
|
|
136
136
|
update_rules_for_lost_replica(scope=scope, name=name, rse_id=rse_id, nowait=True)
|
|
137
137
|
METRICS.counter(name='badfiles.lostfile').inc()
|
|
138
138
|
except (DatabaseException, DatabaseError) as error:
|
|
139
|
-
if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
139
|
+
if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
140
|
+
or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
|
|
141
|
+
or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
|
|
142
|
+
or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
|
|
140
143
|
logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
|
|
141
144
|
else:
|
|
142
145
|
logger(logging.ERROR, str(error))
|
|
@@ -149,7 +152,10 @@ def run_once(heartbeat_handler: HeartbeatHandler, bulk: int, **_kwargs) -> bool:
|
|
|
149
152
|
update_rules_for_bad_replica(scope=scope, name=name, rse_id=rse_id, nowait=True)
|
|
150
153
|
METRICS.counter(name='badfiles.recovering').inc()
|
|
151
154
|
except (DatabaseException, DatabaseError) as error:
|
|
152
|
-
if re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
155
|
+
if (re.match(ORACLE_RESOURCE_BUSY_REGEX, error.args[0])
|
|
156
|
+
or re.match(ORACLE_DEADLOCK_DETECTED_REGEX, error.args[0])
|
|
157
|
+
or re.match(PSQL_PSYCOPG_LOCK_NOT_AVAILABLE_REGEX, str(error.args[0]))
|
|
158
|
+
or MYSQL_LOCK_WAIT_TIMEOUT_EXCEEDED in error.args[0]):
|
|
153
159
|
logger(logging.WARNING, 'Lock detected when handling request - skipping: %s', str(error))
|
|
154
160
|
else:
|
|
155
161
|
logger(logging.ERROR, str(error))
|
rucio/daemons/bb8/bb8.py
CHANGED
|
@@ -23,6 +23,7 @@ import threading
|
|
|
23
23
|
from typing import TYPE_CHECKING, Optional
|
|
24
24
|
|
|
25
25
|
from rucio.common.config import config_get_float
|
|
26
|
+
from rucio.common.constants import DEFAULT_VO
|
|
26
27
|
from rucio.common.exception import InvalidRSEExpression
|
|
27
28
|
from rucio.common.logging import setup_logging
|
|
28
29
|
from rucio.core.heartbeat import list_payload_counts, sanity_check
|
|
@@ -252,7 +253,7 @@ def run_once(
|
|
|
252
253
|
if available_source_rebalance_volume > 0:
|
|
253
254
|
vo_str = (
|
|
254
255
|
" on VO {}".format(destination_rse["vo"])
|
|
255
|
-
if destination_rse["vo"] !=
|
|
256
|
+
if destination_rse["vo"] != DEFAULT_VO
|
|
256
257
|
else ""
|
|
257
258
|
)
|
|
258
259
|
if index == 0 and destination_rse["id"] in dict_locks:
|
rucio/daemons/bb8/common.py
CHANGED
|
@@ -279,7 +279,7 @@ def list_rebalance_rule_candidates(
|
|
|
279
279
|
|
|
280
280
|
vo = get_rse_vo(rse_id=rse_id)
|
|
281
281
|
|
|
282
|
-
# dumps can be applied only for decommission since the dumps doesn't contain info from
|
|
282
|
+
# dumps can be applied only for decommission since the dumps doesn't contain info from DIDs
|
|
283
283
|
if mode == "decommission":
|
|
284
284
|
return _list_rebalance_rule_candidates_dump(rse_id, mode)
|
|
285
285
|
|