Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Adding meta field programmatically in server farm

$
0
0

We're experiencing a very specific issue when it comes to programmatically adding meta fields (to purchase orders, in this case), specifically in a deployment phase. Our process is:

  1. Deploy to editorial server in DMZ (regular IIS).
  2. Create deployment slot in Azure and deploy code to it.
  3. Warm up deployment slot (and editorial server). This takes 4-8 minutes.
  4. Swap deployment slot with production one.

When we add a new meta field, that will be added in a initialization module and it will be executed after step 1 in the process above (as soon as the editorial server is hit by a request I guess). The time between step 1 and step 4, where the production slot is replaced, is like 10 minutes.

During this period of time, there's a mismatch when it comes to meta fields in the purchase order meta class. The new meta field is created, and thus the stored procedure mdpsp_avto_OrderGroup_PurchaseOrder_Update is changed to accept the new meta field. However, the production slot is not aware of the new meta field yet so if a purchase order is created during this time - the site will crash.

My theory is that meta class changes should trigger cache to be invalidated in a server farm. Our event replication in the server farm seems to work though. Currently, I believe that the event broker isn't enabled until after all init modules has been executed (see EventsInitialization...InitComplete). That would explain why the meta class cache isn't invalidated on other servers (since probably no events are sent).

Thoughts anyone?

We're adding meta fields to the purchase order meta class like this: https://github.com/episerver/Foundation/blob/c48e99897bf82c117725d2712719ffd9c2a0addb/src/Foundation.Commerce/Extensions/InitializationEngineExtensions.cs#L64.


Viewing all articles
Browse latest Browse all 8020

Trending Articles