Warning:Table chb_State.Workers object definition does not match the expected reference schema

Warning:Table chb_State.Workers object definition does not match the expected reference schema

book

Article ID: CTX616962

calendar_today

Updated On:

Description

  • The Site test Report shows a warning "Table chb_State.Workers object definition does not match the expected reference schema"

image.png


 
  • CDF traces captured from the DDC while running the Ste test show the below messages:

BrokerService.exe,0,BrokerController,,0,,1,Information,"[TID:c9db3c6c-babe-11ee-8129-7978eebebebe]EnvTest:SchemaNotModified: Table chb_State.Workers was Changed",""

BrokerService.exe,0,BrokerController,,0,,1,Information,"[TID:c9db3c6c-babe-11ee-8129-7978eebebebe]EnvTests: TestId Broker_SchemaNotModified - Warning: DBObjectChanged

Citrix.EnvTest.exe,0,EnvTestLog,,0,,1,Information,"[TID:0c3004ff-c6ac-11ee-813f-7b33b6ca111d]    - Broker_SchemaNotModified - CompleteFailed ddc with 1 details",""

Citrix.EnvTest.exe,0,EnvTestLog,,0,,1,Information,"[TID:0c3004ff-c6ac-11ee-813f-7b33b6ca111d]    - Broker_SchemaNotModified - Target: ddc.domain.com, Endpoint: http://ddc.domain.com/Citrix/BrokerEnvTests/v1, State: CompleteFailed, Started: 2/8/2024 6:01:28 PM, Ended: 2/8/2024 6:02:33 PM, Details:
    Result Details - Issue: DBObjectChanged, ServiceSource: Broker, Severity: Warning, Action: Restore the database xxx to the most recent backup. ActionParameters: xxx, Explanation: Table chb_State.Workers object definition does not match the expected reference schema., ExplanationParameters: Table chb_State.Workers",""

Citrix.EnvTest.exe,0,EnvTestLog,,0,,7,Information,"[TID:0c3004ff-c6ac-11ee-813f-7b33b6ca111d]        DBObjectChanged      Warning         Broker               Restore the database xxx to the most recent backup. Table chb_State.Workers object definition does not match the expected reference schema.",""
 

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Resolution

  • Take full backup of the Citrix Site database.
  • Then follow the below steps to disable page locks for all the affected indexes of chb_State.workers table by setting "Allow Page Locks" to False.

Example: Navigate to Site database -> Tables-> Chb_State.Workers-> Indexes ->  "IX_Workers_DesktopGroupUid_PowerSinBinReleaseTime  -> Right click Properties -> Options and set Allow page locks to False

image.png
  • If you do not wish to make the changes for multiple tables, via SQL Management Studio UI, you can run the below  SQL query in SQL CMD mode on the SQL server hosting the Citrix database. Ensure that you replace the SiteDBName with the actual name of your site database and the IndexName with the name of the affected index.

USE SiteDBName;

GO  
ALTER Index IndexName ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  
GO  

Example:

USE SiteDBName;

GO  
ALTER Index IX_Workers_DesktopGroupUid_PowerSinBinReleaseTime ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  
GO  
ALTER Index IX_Workers_DesktopUid ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  
GO  
ALTER Index IX_Workers_LastPowerManagementActionUid ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)
GO  
ALTER Index IX_Workers_PowerManagementActionUid ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  
GO  
ALTER Index IX_Workers_RebootCycleUid ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  
GO  
ALTER Index PK_Workers ON chb_State.Workers
SET (ALLOW_PAGE_LOCKS = OFF)  

 

Problem Cause

On comparing the Actual and Expected schema for the table chb_State.Workers from the CDF traces, it was found that  "Allow Page Locks" property was modified and not set to default.

 

Issue/Introduction

The article describes how to modify "Allow Page Locks" property of SQL Indexes

Additional Information

https://learn.microsoft.com/en-us/answers/questions/424290/disable-page-lock

https://www.sqlpassion.at/archive/2016/10/31/disabling-row-and-page-level-locks-in-sql-server/

https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-indexoption-transact-sql?view=sql-server-ver16

https://xnerv.wang/disabling-row-and-page-level-locks-in-sql-server/

https://www.mssqltips.com/sqlservertip/4247/resolve-sql-server-database-index-reorganization-page-level-locking-problem/

https://www.sqlpassion.at/archive/2016/10/31/disabling-row-and-page-level-locks-in-sql-server/