Data Status update is not working under clustered environment

I have…

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x ] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Expected behavior

We are setting data status from draft to Published. It worked fine in development with single cluster. However, after deployed in Production env with load balance, it did not work

Minimal reproduction of the problem

  1. Create a schema and add some data
  2. Update data status from Draft to Published using API
  3. Run the Update in a clustered env with load balance
    expected: Draft status to Published
    Actual: Draft stay as draft without showing errors

Environment

App Name:

  • [ x] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x ] Cloud version

Version: [VERSION]
7
Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Are you talking about scheduled publishing? Then you need at least on worker. The Squidex is clustered as well, so I am 100% sure that this works.

The way we did is a manual Task to run ad hoc. We only need the task run once, not need every day. Is that supposed to work?

I have no idea what you mean

Here is my use case.

  1. there are 25000 records for the schema, of which 51 are in draft status. We need to set those 51 to Published status

  2. Here is my code

     private async Task SetStateAndOtherJurisdictionsToPublished()
     {
         var queryResult = await jurisdictionSquidexClient.GetAsync(new ContentQuery
         {
             Filter = "data/Level/iv eq 'state' or data/Level/iv eq 'other'"
         }, QueryContext.Default.Unpublished(true));
         foreach (var item in queryResult.Items)
         {
             await jurisdictionSquidexClient.ChangeStatusAsync(item, new ChangeStatus()
             {
                 Status = WorkflowStatuses.Published
             });
         }
     }
    

All works fine in our testing env with single cluster, but the status are not changed to Published in living env with cluster.
Hope this is understood.

Please format your code properly. Use code blocks with ```

So in summary we have some non-Published content where the Level property’s value is either state or other that we want to set as Published as a one off update.

Although there are 25000 records in the schema there should be far fewer, less than 100, matching that Filter. Apparently this worked well for us on a single instance (single worker and API node) but not when load balanced (one worker and one API node).

To be honest though I do not know why we are making this change via code as if it is less than 100 records and we are just changing the status we can easily just use the UI to do it, just two pages of bulk updating after applying the filters, for example:

But the code is the same for clustered vs non clustered. There is also no caching or so