Record the number of updates to a NoteDb ref
Eventually we may want to limit the total length of a NoteDb ref's history, to avoid having to scan and store an unbounded amount of commit data into ChangeNotes. To do that, we first need to record it. In most cases, this number will equal getChangeMessages().size(), but that's partly an artifact of the current APIs, which always accompany a change with a ChangeMessage. The underlying storage layer doesn't require it. Don't bump the ChangeNotesCache version number: old entries will just return an update count of 0. My current thinking is that populating this field is not worth flushing the persistent cache. If we change our minds, we can trivially bump the version number. Change-Id: I9fbcdfa0583a525e60b75672032f3179e5da3c79
This commit is contained in:
@@ -75,7 +75,7 @@ message ChangeNotesKeyProto {
|
||||
// Instead, we just take the tedious yet simple approach of having a "has_foo"
|
||||
// field for each nullable field "foo", indicating whether or not foo is null.
|
||||
//
|
||||
// Next ID: 19
|
||||
// Next ID: 20
|
||||
message ChangeNotesStateProto {
|
||||
// Effectively required, even though the corresponding ChangeNotesState field
|
||||
// is optional, since the field is only absent when NoteDb is disabled, in
|
||||
@@ -183,6 +183,9 @@ message ChangeNotesStateProto {
|
||||
|
||||
reserved 17; // read_only_until
|
||||
reserved 18; // has_read_only_until
|
||||
|
||||
// Number of updates to the change's meta ref.
|
||||
int32 update_count = 19;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user