Developer forum

Forum » Dynamicweb 10 » What triggered an Index Build?

What triggered an Index Build?

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Is there a way to see what or who starts an index build? I have a Repository that mysteriously builds itself during daytime. It's a huge one (500K+ products) and takes a few hours. I tested all the ways that could cause the trigger that I know of:

1. User action - everyone claims it wasn't them.
2. Integration job - No jobs have a repo set to rebuild
3. A scheduled task pointing to my repo - doesn't exist
4. A schedule on the repo directly. There is one, but it's set to 2:30 AM:

Is there anything in a log file or so that could help me find what triggered it?

Imar


Replies

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Imar,

 

The only thing I can think of is:

  • Under Diagnostics, there a different between the index triggered by the Build Task (the one that we don't like because it uses the end time to figure out the next run - in other words, if you set it to rebuild every 24h, rebuilding at 9am and it takes 1h to build, in a few days it rebuilds at 2pm)
    https://app.screencast.com/f63NcYgyGmtGW
  • The command log could help you track down when and who triggered the action to rebuild
    https://doc.dynamicweb.dev/manual/dynamicweb10/settings/system/system/commandlog.html
    (you'd need to search for the name of the command - maybe something with "build" or "index")
    • Probably easier to search in Firehose

 

Best Regards,

Nuno Aguiar

 

 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Nuno!

For #1, I have this:

The one in the middle is the one that ran this afternoon (the secondary instances). The first one hasn't been updated in a few days so may be stale while the last one has the data of last night at 2:30 for which I scheduled my task.

For #2, all I see this this:

So nothing happened at 8:30-ish in the morning today.

When I search for BuildIndexInstance I get this:

which confirms what users are saying: it wasn't them executing the build :-)

I guess when an index is built from an activity, it uses the .NET APIs directly and doesn't go through the Admin API and therefore not the Command Log I assume.

I then downloaded all the job files and searched for the text RepositoriesIndexUpdate which stores info on which indexes to update. Most came up with an empty element like this <RepositoriesIndexUpdate /> which means no index is configured.

However, one came up like this:

<RepositoriesIndexSettings>
  <RepositoriesIndexUpdate>
    <index>SwiftProducts-Products.index-Products</index>
  </RepositoriesIndexUpdate>
</RepositoriesIndexSettings>

Ah, a smoking gun. However, the job is not a regular job but a personal one under Jobs/Personal/{UserId}/TemporaryConfig.xml. Looks like these capture personal configuration data for a job. 

Does anyone know how these are used? Looks like a backend user is executing some other import or export job which uses this file as the default? The UserId in the location matches a user that does a lot of backend work.

Can these files be deleted?

Imar

 

 

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Imar,

 

What a great find.

 

I would expect that file can be deleted judging by it's name (TemporaryConfig.xml). Makes me think of the Import/Export features in PIM. At least I remember seeing a similar name when I play around with it. I assume that user uses it as his/her "remebered" settings while doing import/exports. Could that be it?

 

I'm also guessing this is happenening because they are doing a lot of product updates, which you sort of want to see the results in PIM. Maybe this is the typical case where you'd have 2 repositories (one for the backend - expected quick and with multiple updates; another for the frontend). And then you could update the reference to a different index.

Additionally have you checked if setting a Partial update build would work better? I don't see anything in that XML config that picks a build, but maybe DW does it automatically? That would take a few seconds/minutes instead of the hours your index takes.

 

Thoughts?

Nuno

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Nuno,

>> Makes me think of the Import/Export features in PIM

Yeah, that's exactly where they are coming from I believe: where https://doc.dynamicweb.com/forum/pim/pim/unable-to-import-csv-file-to-pim-group

>> Maybe this is the typical case where you'd have 2 repositories (one for the backend - expected quick and with multiple updates; another for the frontend)

We have that. Hard to do otherwise with a 500K products catalog :-)

>> Additionally have you checked if setting a Partial update build would work better? I don't see anything in that XML config that picks a build, but maybe DW does it automatically?

Good question; not sure how that works. For now I've simply deleted the temp files.

Imar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

This has happened again. Someone did an Excel import which created the temp under Personal file which caused an Index rebuild because of these settings:

 <RepositoriesIndexSettings>
    <RepositoriesIndexUpdate>
      <index>SwiftProducts-Products.index-Products</index>
    </RepositoriesIndexUpdate>
  </RepositoriesIndexSettings>

Anyone from the Core team who can confirm why this is happening and how to stop it?

Imar

 

 

 

You must be logged in to post in the forum