Governance

Query Expired Time Triggers (AKA: Governance Settings)

SELECT 
  count("Join2"."Id") 
FROM 
  (
    SELECT 
      "Extent1"."NodeID", 
      "Extent1"."AccountID", 
      "Extent1"."Id" 
    FROM 
      "public"."DbTriggerToNode" AS "Extent1" 
      INNER JOIN "public"."DbTriggers" AS "Extent2" ON "Extent1"."TriggerID" = "Extent2"."Id" 
      AND "Extent1"."AccountID" = "Extent2"."AccountID" 
      INNER JOIN "public"."DbTimeTriggers" AS "Extent3" ON "Extent1"."AccountID" = "Extent2"."AccountID" 
      AND "Extent1"."TriggerID" = "Extent2"."Id" 
      AND "Extent3"."AccountID" = "Extent2"."AccountID" 
      AND "Extent3"."TriggerID" = "Extent2"."Id" 
    WHERE 
      1 = "Extent2"."TriggerType" 
      AND "Extent1"."Failed" != TRUE 
      AND 0 = "Extent1"."InheritanceBehavior" 
      AND "Extent3"."TimeSpanInSeconds" IS NOT NULL 
      AND "Extent1"."DateApplied" + CAST (
        "Extent3"."TimeSpanInSeconds" / 31556952 :: int8 AS int4
      ) * INTERVAL '1 Years' + CAST (
        "Extent3"."TimeSpanInSeconds" - "Extent3"."TimeSpanInSeconds" / 31556952 :: int8 * 31556952 :: int8 AS int4
      ) * INTERVAL '1 Seconds' < CAST (
        CURRENT_TIMESTAMP AT TIME ZONE 'UTC' AS timestamp
      )
  ) AS "Join2" 
  LEFT OUTER JOIN "public"."DbNodes" AS "Extent4" ON "Join2"."NodeID" = "Extent4"."Id" 
  AND "Join2"."AccountID" = "Extent4"."AccountID" 
WHERE 
  1 = "Extent4"."SystemType" 
  OR 4 = "Extent4"."SystemType" 
  OR 5 = "Extent4"."SystemType" 
  OR 6 = "Extent4"."SystemType" 
  OR 7 = "Extent4"."SystemType" 
  OR 18 = "Extent4"."SystemType"

 

Batch Worker Processing

TimeTriggerWorkerThreadCount

The TimeTriggerWorker in the Batch Worker, processes expired governance settings. By default, it does this one at a time, but can be adjusted to process in a multithreaded manner by setting the TimeTriggerWorkerThreadCount app setting.

In August of 2024, we realized this setting was set to the default value of 1, and had about 100k expired settings it was backed up in processing. We have since bumped it much higher.

Inheritance Behavior: Applies to all Items

The 'Applies to all Items' inheritance behavior does not work exactly how you'd expect. For folders (and other non-file nodes) Governance settings inherited with this behavior, the setting doesn't actually ever expire, so the expiration action will never occur.

The reason this is happening is because the inheritance behavior on the dbTriggerToNode is not set to none, and we only expire time triggers when the inheritance behavior on dbTriggerToNode is set to none. 

Changing what the inheritance behavior is set to on dbTriggerToNode could have cascading effects and be quite risky to change, so we have selected to not categorize this as a bug, but instead the intended design.