Skip to content

Commit

Permalink
Added support for returning LostChagnes (large change) and first lost…
Browse files Browse the repository at this point in the history
… change of TruncatedJournal

Summary:
# Context

We are introducing EdenFS notifications to support scalable and ergonomic file system notifications for EdenFS mounts.

# This Diff

Adds new type of LargeChangeNotification - LostChanges. To validate the end-to-end support, this change also include detecting and reporting when the journal has been truncated.

# Next Steps

* Additional LostChanges: EdenFsRestarted and TooManyChanges
* Collapsing journal entries
* .t tests, Python integration tests, C++ unit tests

# Discussion Points

None

Reviewed By: MichaelCuevas

Differential Revision: D66126209

fbshipit-source-id: d5deed4d1b50d9a425275614b45a09024ae50679
  • Loading branch information
jdelliot authored and facebook-github-bot committed Nov 19, 2024
1 parent 4e8f678 commit 204dd69
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions eden/fs/service/eden.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,31 @@ struct CommitTransition {
2: ThriftRootId to;
}

/*
* Large change notification returned when invoking changesSinceV2.
* Indicates that EdenfS was unable to track changes within the given
* mount point since the provided journal poistion. Callers should
* treat all filesystem entries as changed.
*/
enum LostChangesReason {
// Unknown reason.
UNKNOWN = 0,
// The given mount point was remounted (or EdenFS was restarted).
EDENFS_REMOUNTED = 1,
// EdenFS' journal was truncated.
JOURNAL_TRUNCATED = 2,
// There were too many change notifications to report to the caller.
TOO_MANY_CHANGES = 3,
}

/*
* Large change notification returned when invoking changesSinceV2.
* Indicates that EdenFS was unable to provide the changes to the caller.
*/
struct LostChanges {
1: LostChangesReason reason;
}

/*
* Change notification returned when invoking changesSinceV2.
* Indicates that the given change is large in impact - affecting
Expand All @@ -1866,6 +1891,7 @@ struct CommitTransition {
union LargeChangeNotification {
1: DirectoryRenamed directoryRenamed;
2: CommitTransition commitTransition;
3: LostChanges lostChanges;
}

/*
Expand Down

0 comments on commit 204dd69

Please sign in to comment.