Skip to content

Slow store initialization due to acs size queries #6124

Description

@moritzkiefer-da

Seen in the logs here

The logs don't make it all that clear what is happening there but looking at the code the only thing that comes to mind is this query

        acsSizeInDb <- acsInitResult match {
          case StoreHasData(acsStoreId, _) =>
            storage
              .querySingle(
                sql"""
                  select count(*)
                  from #$acsTableName
                  where store_id = ${acsStoreId} and migration_id = $domainMigrationId
                  """.as[Int].headOption,
                "initialize.getAcsCount",
              )
              .getOrElse(0)
          case _ => FutureUnlessShutdown.pure(0)

This also seems to be in line with these metrics that also show initialize taking 30s

Image

We definitely need to fix that, a store reinitialization should be a noop and it very much is not atm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions