{"record":{"id":"de632164a97a9978","repo":"weaviate/weaviate","slug":"store-secondary-bloom-filter-on-disk-w","errorCode":null,"errorMessage":"store secondary bloom filter on disk: %w","messagePattern":"store secondary bloom filter on disk: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/lsmkv/segment_bloom_filters.go","lineNumber":209,"sourceCode":"\n\ts.logger.WithField(\"action\", \"lsm_init_disk_segment_build_bloom_filter_secondary\").\n\t\tWithField(\"secondary_index_position\", pos).\n\t\tWithField(\"path\", s.path).\n\t\tWithField(\"took\", took).\n\t\tDebugf(\"building bloom filter took %s\\n\", took)\n\n\treturn nil\n}\n\nfunc (s *segment) computeAndStoreSecondaryBloomFilter(path string, pos int) error {\n\tcount := s.secondaryIndices[pos].KeyCount()\n\ts.secondaryBloomFilters[pos] = bloom.NewWithEstimates(uint(count), 0.001)\n\ts.secondaryIndices[pos].ForEachKey(func(key []byte) {\n\t\ts.secondaryBloomFilters[pos].Add(key)\n\t})\n\n\tif err := s.storeBloomFilterSecondaryOnDisk(path, pos); err != nil {\n\t\treturn fmt.Errorf(\"store secondary bloom filter on disk: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (s *segment) storeBloomFilterSecondaryOnDisk(path string, pos int) error {\n\tbfSize := getBloomFilterSize(s.bloomFilter)\n\n\trw := byteops.NewReadWriter(make([]byte, bfSize+byteops.Uint32Len))\n\trw.MoveBufferPositionForward(byteops.Uint32Len) // leave space for checksum\n\t_, err := s.secondaryBloomFilters[pos].WriteTo(&rw)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"write bloom filter: %w\", err)\n\t}\n\n\treturn writeWithChecksum(rw, path, s.observeMetaWrite)\n}\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/lsmkv/segment_bloom_filters.go#L191-L227","documentation":"Wraps storeBloomFilterSecondaryOnDisk failures after computing a secondary-index bloom filter. The filter was built in memory from the secondary index's keys but persisting it via writeWithChecksum failed — disk-level cause (space, permissions, I/O).","triggerScenarios":"computeAndStoreSecondaryBloomFilter during segment init when the .secondary.<pos>.bloom sidecar is missing or failed checksum load, and the subsequent os.Create/write fails (ENOSPC, EACCES, EIO).","commonSituations":"Disk full on shards with secondary indexes (e.g. tenant/partition properties); read-only or quota-limited volume; directory removed while the process runs.","solutions":["Free disk space on the data volume.","Check write permissions on the shard directory.","Inspect host storage logs for hardware/device I/O errors.","Restart Weaviate — the secondary bloom filter is recomputed from the secondary index."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check free space and writability before starting shards with secondary indexes\nst, err := syscall.Statfs(dataDir)\nif err == nil && uint64(st.Bavail)*uint64(st.Bsize) < minFreeBytes {\n    return fmt.Errorf(\"low disk space for bloom sidecars\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor free disk space on volumes with secondary-index-heavy schemas.","Alert at 80% capacity; bloom sidecars are written at segment open/flush time.","Keep shard directories writable by the weaviate user.","Restart cleanly after fixing disk pressure — filters are recomputed automatically."],"tags":["filesystem","lsmkv","bloom-filter","secondary-index","disk-full"],"backgroundTag":"disk-full-write-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}