{
  "id": "mongodb/timeseries-bucket-max-size-exceeded",
  "signature": "MongoServerError: time series bucket max size exceeded: bucket with id '...' has more than 1000 measurements",
  "signature_zh": "MongoServerError：时间序列桶最大大小超出：ID为'...'的桶包含超过1000个测量值",
  "regex": "time series bucket max size exceeded: bucket with id '[a-f0-9]+' has more than 1000 measurements",
  "domain": "mongodb",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A single time series bucket collected more than the default 1000 measurements due to high-frequency writes with identical meta fields, exceeding the bucket's maximum measurement limit.",
  "root_cause_type": "generic",
  "root_cause_zh": "由于具有相同元字段的高频写入，单个时间序列桶收集了超过默认1000个测量值，超出了桶的最大测量限制。",
  "versions": [
    {
      "version": "mongodb 6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb 8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The bucket limit is enforced by the storage engine; recreating with the same schema does not change the behavior, and the error will recur.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Directly modifying internal bucket collections can corrupt the time series data and is not supported by MongoDB; it may cause query failures.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "While this might reduce bucket size, it increases latency and reduces throughput; it does not fix the root cause of meta field overlap.",
      "fail_rate": 0.65,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a unique identifier (e.g., device ID + timestamp prefix) to the meta field to ensure finer bucket granularity: `db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'metadata', granularity: 'seconds' } })` with `metadata: { deviceId: 'sensor1', batch: Date.now() }` in inserts.",
      "success_rate": 0.9,
      "how": "Add a unique identifier (e.g., device ID + timestamp prefix) to the meta field to ensure finer bucket granularity: `db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'metadata', granularity: 'seconds' } })` with `metadata: { deviceId: 'sensor1', batch: Date.now() }` in inserts.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the bucket max size parameter: `db.adminCommand({ setParameter: 1, timeseriesBucketMaxCount: 2000 })` to allow up to 2000 measurements per bucket.",
      "success_rate": 0.85,
      "how": "Increase the bucket max size parameter: `db.adminCommand({ setParameter: 1, timeseriesBucketMaxCount: 2000 })` to allow up to 2000 measurements per bucket.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use the `granularity` option to control bucket time range: set `granularity: 'seconds'` to limit bucket to 1-second intervals, reducing measurement count per bucket.",
      "success_rate": 0.8,
      "how": "Use the `granularity` option to control bucket time range: set `granularity: 'seconds'` to limit bucket to 1-second intervals, reducing measurement count per bucket.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add a unique identifier (e.g., device ID + timestamp prefix) to the meta field to ensure finer bucket granularity: `db.createCollection('sensor_data', { timeseries: { timeField: 'timestamp', metaField: 'metadata', granularity: 'seconds' } })` with `metadata: { deviceId: 'sensor1', batch: Date.now() }` in inserts.",
    "Increase the bucket max size parameter: `db.adminCommand({ setParameter: 1, timeseriesBucketMaxCount: 2000 })` to allow up to 2000 measurements per bucket.",
    "Use the `granularity` option to control bucket time range: set `granularity: 'seconds'` to limit bucket to 1-second intervals, reducing measurement count per bucket."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/core/timeseries-collections/#bucket-limits",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2024-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}