From a6ea97b9844c9b78c7e9b24c241fc16be22e4176 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 13 Jun 2021 00:05:20 +0300 Subject: Skip/remove dangling implicit associations --- bpkg/database.hxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'bpkg/database.hxx') diff --git a/bpkg/database.hxx b/bpkg/database.hxx index 53ca54a..735fe7f 100644 --- a/bpkg/database.hxx +++ b/bpkg/database.hxx @@ -143,11 +143,18 @@ namespace bpkg // By default attach and cache the implicitly associated configuration // databases on the first call and return them along with the self- - // association (comes first). If attach is false, then return an empty - // list if associations were not yet cached by this function's previous - // call. - // - // Note that for implicitly associated configurations the association + // association (comes first), silently skipping the dangling + // associations. If attach is false, then return an empty list if + // associations were not yet cached by this function's previous call. + // + // Note that we skip dangling associations without any warning since they + // can be quite common. Think of a shared host configuration with a bunch + // of implicitly associated configurations, which are removed and + // potentially recreated later during the host configuration lifetime. + // Note however, that we remove the dangling implicit associations during + // migration (see migrate() on details). + // + // Also note that for implicitly associated configurations the association // information (id, etc) is useless, thus we only return the databases // rather than the association information. // @@ -311,7 +318,10 @@ namespace bpkg // // Note that since the whole associated databases cluster is migrated at // once, it is assumed that if migration is unnecessary for this database - // then it is also unnecessary for its associated databases. + // then it is also unnecessary for its associated databases. By this + // reason, we also drop the dangling implicit associations rather than + // skip them, as we do for normal operations (see implicit_associations () + // for details). // void migrate (); -- cgit v1.1