{
  "ticket": "U87 #124",
  "generatedAt": "2026-10-28T23:08:54.031541+08:00",
  "startedAt": "2026-10-28T23:08:29.438669+08:00",
  "runId": "2308299e2d",
  "input": "python3 labs/data-tenant-quota/run.py",
  "environment": {
    "os": "macOS-27.2-arm64-arm-64bit",
    "arch": "arm64",
    "jdk": "openjdk version \"21.0.11\" 2026-04-21 LTS",
    "mysql": "8.4.7",
    "spark": "/___/ .__/\\_,_/_/ /_/\\_\\   version 4.0.1",
    "sparkTarSha512Prefix": "9198602c6b931b46",
    "sparkState": "cached",
    "pymysql": "1.1.2",
    "externalServices": "MySQL 127.0.0.1:3306 独有库 study_u87_2308299e2d；Spark local[2] 本机 Structured Streaming；无集群"
  },
  "scenarios": [
    {
      "name": "quota-token-bucket",
      "startedAt": "2026-10-28T23:08:31.117563+08:00",
      "finishedAt": "2026-10-28T23:08:31.233638+08:00",
      "observed": [
        "U87OBS quotaRequests tenantA=3 tenantB=3 total=6",
        "U87 quotaRemaining tenantA=2 tenantB=2 requestedEach=3"
      ]
    },
    {
      "name": "lease-generation",
      "startedAt": "2026-10-28T23:08:31.233744+08:00",
      "finishedAt": "2026-10-28T23:08:35.930891+08:00",
      "observed": [
        "U87 leaseAcquire holder=worker-a generation=1",
        "U87 leaseHolderKilled signal=SIGKILL",
        "U87OBS leaseTakeover owner=worker-a affected=1 generation=2",
        "U87OBS leaseOwnerOnlyMatches owner=worker-a count=1",
        "U87OBS leaseStaleWrite owner=worker-a generation=1 affected=0",
        "U87 leaseFinal owner=worker-a generation=2"
      ]
    },
    {
      "name": "checkpoint-vs-business",
      "startedAt": "2026-10-28T23:08:35.930977+08:00",
      "finishedAt": "2026-10-28T23:08:53.585534+08:00",
      "observed": [
        "U87 checkpointFirstRun exit=0 businessRows=5",
        "U87 checkpointFailedBusiness exit=1 businessRows=5",
        "U87 checkpointConclusion 引擎可先失败；checkpoint 是否推进要看下一次运行实际读取的批次",
        "U87 checkpointReplay exit=0 businessRows=8",
        "U87 checkpointReplayBatches epoch1Reprocessed=True",
        "U87 checkpointReplayAgain exit=1 businessRows=8 epoch1Reprocessed=True tamperGuardFired=True"
      ]
    },
    {
      "name": "quota-block-and-recover",
      "startedAt": "2026-10-28T23:08:53.585612+08:00",
      "finishedAt": "2026-10-28T23:08:53.950093+08:00",
      "observed": [
        "U87 quotaGate blockedStatus=REJECTED tokensAtBlock=0 businessRowsBlocked=0",
        "U87 quotaGate recoveredStatus=ACCEPTED tokensAfter=2 businessRowsAccepted=1"
      ]
    }
  ],
  "observed": [
    "U87 preflight db=study_u87_2308299e2d mysql=8.4.7",
    "U87 scenarios completed"
  ],
  "exitCode": 0,
  "failure": null,
  "errors": [],
  "rawLogs": "/Users/gaochao/.cache/software-engineering-study/java-depth-impl/u87/runtime/run-2308299e2d",
  "cleanup": {
    "processesSurviving": [],
    "databaseDropped": true,
    "dropError": null,
    "orphanDatabasesDropped": [],
    "labDatabasesRemaining": [],
    "runtimeDir": "/Users/gaochao/.cache/software-engineering-study/java-depth-impl/u87/runtime/run-2308299e2d"
  },
  "runnerSha256": "38a9d14d44cecc4b1bb85afb8dc2c2faa94d5d014a689565b2f7366969bd1b92",
  "limits": [
    "租户配额在 MySQL 行锁上实现（UPDATE ... WHERE tokens > 0），不是独立配额服务；并发为 6 个线程，未做高并发压测。",
    "代际租约用 expires_at 列 + 条件更新实现；SIGKILL 是真实注入，未覆盖时钟回拨与多机时钟偏差。",
    "checkpoint 场景用 Spark Structured Streaming 的 availableNow 触发，业务写走 foreachBatch + pymysql；不是 Flink checkpoint，也不覆盖 exactly-once 端到端语义（业务侧靠唯一键 INSERT IGNORE 保证幂等）。",
    "Spark 为 local[2]；资源超限的\"集群级\"配额（YARN/K8s 队列、Spark dynamic allocation）未运行。",
    "MySQL 为本机 DBngin 8.4.x 独有库，结束 DROP；所有数据为合成标签。"
  ]
}
