Duplicate last_heartbeat_ts_seconds_webdrm Entries in MongoDB Keystore
Original Question or Issue:
system error that are continuing after software update
Environment:
- Product - FileCloud Server
- Version - 23.253
- Platform - Windows
Steps to Reproduce:
Error or Log Message:
E11000 duplicate key error collection: tonidosettings.keystore index: settingkey_index dup key: { key: "last_heartbeat_ts_seconds_webdrm
Defect or Enhancement Number:
FCL-8724
Cause:
The issue is caused by a race condition in how FileCloud writes heartbeat records to the MongoDB keystore collection.
-
Multiple Message Queue workers perform the WebDRM heartbeat check at nearly the same time
-
Each worker attempts to insert a new record instead of updating the existing one
-
Since the current implementation does not enforce uniqueness or use an upsert operation, duplicate entries are created
As a result, multiple records with nearly identical timestamps (often differing by only milliseconds) are stored for the same key:last_heartbeat_ts_seconds_webdrm
Resolution or Workaround:
This behavior is confirmed to be a bug in FileCloud caused by a race condition in the current implementation.
Details
-
The existing design inserts records into the
keystorecollection without enforcing uniqueness -
When multiple Message Queue workers perform the heartbeat check simultaneously, duplicate entries are created
-
These entries typically differ only by a few milliseconds, confirming concurrent execution
Notes: