teleport icon indicating copy to clipboard operation
teleport copied to clipboard

fix duplicate session recording creation

Open fspmarshall opened this issue 5 months ago • 0 comments

Fixes an issue where duplicate session recordings could end up being created in teleport clusters experiencing interruptions during session recording upload from agent to auth. In all observed cases of this bug, it seems to have been produced by a combination of two factors:

  • Agents weren't syncing their upload status to disk until after the first successful event submission, increasing the likelihood that agents would create orphaned uploads.
  • Auth servers were uploading slices even when empty, increasing the likelihood of orphaned upload attempts resulting in session recordings being crated.

Both of the above cases are addressed in this PR. Note, however, that this PR does not address correctly selecting the non-empty upload for existing recordings affected by this issue. That will have to be the subject of future work (see https://github.com/gravitational/teleport/issues/45917). It also doesn't prevent duplicates due to loss of agent-side cursor state or timeout of a partially completed upload attempt (e.g. due to an agent being offline for a prolonged period of tim), both of which were previously known "expected" cases in which duplicate recordings could be produced.

This issue is loosely related to https://github.com/gravitational/teleport/pull/45786 as the two issues tend to happen together since they are both triggered when the session recording system is under extremely high load.

changelog: fixed an issue that could result in duplicate session recordings being created

fspmarshall avatar Aug 26 '24 21:08 fspmarshall