• Vincent Pelletier's avatar
    ZSQLCatalog: Make _reindexObjectList tolerate duplicate documents · 667c91df
    Vincent Pelletier authored
    When _reindexObjectList receives a document more than once (which may
    happen when multiple different-tag indexation activities are spawned for
    the same document), it would emit a meaningless error, saying that
    document /foo/bar stole the uid of document /foo/bar.
    Instead, fix duplicate tracking and skip such dulicates.
    
    Also, simplify & make _reindexObjectList more robust:
    - Always check path length.
    - Allocate uids before looking for duplicates in catalog (it may not be
      actually needed at this level nowadays).
    - Always check both uid-to-path and path-to-uid mappings.
    - Reuse existing mappings to detect duplicates among objects being reindexed,
      removing the need for assigned_uid_dict.
    - Avoid computing path more than once, as it's expensive.
    667c91df
SQLCatalog.py 96.2 KB