• Vincent Pelletier's avatar
    SQLCatalog_deferFullTextIndex{,Activity}: Use serialization_tag . · b41dc8e0
    Vincent Pelletier authored
    Just like regular indexations, fulltext indexations are subject to last-commit-wins.
    Which means that it is possible to reach a state where the fulltext table is
    persistently desynchronised from ZODB:
    - start fulltext indexation activity on many documents (typically: 100)
    - modify one of the documents being indexed
    - start fulltext indexation activity caused by this edit, and assume indexation only
    happens for this object
    - commit the single-object indexation (because it is very fast to retrieve fulltext
    data from just one document)
    - commit the many-objects indexation later (because it is much slower to
    retrieve 100 fulltext representations)
    
    As a consequence, cod emust spawn one fulltext indexation activity per
    document, each with the appropriate serialisation tag. Serialisation tag which
    must not conflict with regular indexation, so use a fixed prefix.
    As a consequence of having to spawn one activity per document, use a
    grouping method to still index by batches to amortise transaction overhead.
    Keep the same method_id as before for backward-compatibility (maybe
    dependencies on this value exist, even though it is bad practice).
    Rewrite SQLCatalog_deferFullTextIndexActivity so ot works as a grouping
    method, simplifying it in the process:
    - build parameter_dict with all entries, as we already know all needed keys
    - None is not callable, so test "not None" in just one expression
    - remove whitespace at end of line
    - use GroupedMessage API
    b41dc8e0
SQLCatalog_deferFullTextIndexActivity.py 943 Bytes