TranslationImportQueueEntry:+index timeouts approving translation templates

Bug #719267 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Jeroen T. Vermeulen

Bug Description

When I try to approve a template upload for sbackup, I hit timeouts like OOPS-1872C1062.

Tags: qa-ok timeout

Related branches

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

I don't think there's much we can do about this except move statistics computation out of the web UI transaction. Statistics computation seems to be much faster now, issuing only 2 reasonably fast queries per POFile, but it still adds up to too much with the sharing.

summary: - Translation template approval times out
+ TranslationImportQueueEntry:+index timeouts approving translation
+ templates
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Actually, there really doesn't seem to be any point to calculating the statistics during approval. The template is created empty!

Revision history for this message
Robert Collins (lifeless) wrote :
Download full text (4.1 KiB)

I don't know if this is helpful, but trying with multiple languages in one of the repeated 300ms queries got this:
 launchpad_qastaging=> explain analyze SELECT COUNT(*)
FROM
  (SELECT DISTINCT ON (TTI.potmsgset, current.language) *
   FROM TranslationTemplateItem TTI
   LEFT OUTER JOIN TranslationMessage AS CURRENT ON CURRENT.potmsgset = TTI.potmsgset
   AND CURRENT.LANGUAGE in (193, 196)
   AND COALESCE(CURRENT.potemplate, 41015) = 41015
   AND CURRENT.is_current_upstream IS TRUE
   WHERE TTI.potemplate = 41015
     AND TTI.sequence > 0
     AND EXISTS
       (SELECT *
        FROM TranslationMessage Suggestion
        WHERE Suggestion.potmsgset = TTI.potmsgset
          AND Suggestion.LANGUAGE = current.language
          AND Suggestion.is_current_upstream IS FALSE
          AND COALESCE(Suggestion.msgstr0, Suggestion.msgstr1, Suggestion.msgstr2, Suggestion.msgstr3, Suggestion.msgstr4, Suggestion.msgstr5) IS NOT NULL
          AND Suggestion.date_created > COALESCE(CURRENT.date_reviewed, CURRENT.date_created, TIMESTAMP 'epoch'))
   ORDER BY TTI.potmsgset, current.language, CURRENT.potemplate NULLS LAST) AS messages_with_suggestions
group by messages_with_suggestions.language;
                                                                                                            QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 HashAggregate (cost=2550.27..2550.29 rows=1 width=4) (actual time=0.028..0.028 rows=0 loops=1)
   -> Unique (cost=2550.09..2550.26 rows=1 width=94) (actual time=0.024..0.024 rows=0 loops=1)
         -> Sort (cost=2550.09..2550.15 rows=22 width=94) (actual time=0.024..0.024 rows=0 loops=1)
               Sort Key: tti.potmsgset, current.language, current.potemplate
               Sort Method: quicksort Memory: 25kB
               -> Nested Loop Semi Join (cost=12.25..2549.60 rows=22 width=94) (actual time=0.016..0.016 rows=0 loops=1)
                     Join Filter: (suggestion.date_created > COALESCE(current.date_reviewed, current.date_created, '1970-01-01 00:00:00'::timestamp without time zone))
                     -> Nested Loop Left Join (cost=12.25..1624.46 rows=77 width=94) (actual time=0.015..0.015 rows=0 loops=1)
                           -> Index Scan using translationtemplateitem__potemplate__sequence__key on translationtemplateitem tti (cost=0.00..215.64 rows=77 width=16) (actual time=0.014..0.014 rows=0 loops=1)
                                 Index Cond: ((potemplate = 41015) AND (sequence > 0))
                           -> Bitmap Heap Scan on translationmessage current (cost=12.25..18.27 rows=2 width=78) (never executed)
                                 Recheck Cond: ((current.potmsgset = tti.potmsgset) AND (current.language = ANY ('{193,196}'::integer[])))
                                 Filter: ((current.is_current_upstream IS TRUE) AND (COALESCE(current.potemplate, 41015) = 41015))
   ...

Read more...

Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in launchpad:
assignee: nobody → Jeroen T. Vermeulen (jtv)
milestone: none → 11.03
tags: added: qa-needstesting
Changed in launchpad:
status: Triaged → Fix Committed
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.