feat(log_store): introduce the CollectionTask (#4530)

* feat: introduce the `CollectionTask`

* feat: add config of index collector

* chore: remove unused code

* feat: truncate indexes

* chore: apply suggestions from CR

* chore: update config examples

* refactor: retrieve latest offset while dumping indexes

* chore: print warn
This commit is contained in:
Weny Xu
2024-08-19 11:48:35 +08:00
committed by GitHub
parent 2a73e0937f
commit 76dc906574
24 changed files with 578 additions and 102 deletions

View File

@@ -89,7 +89,7 @@ impl<S: LogStore> Wal<S> {
move |region_id, last_entry_id, provider| -> BoxFuture<'_, Result<()>> {
Box::pin(async move {
store
.obsolete(provider, last_entry_id)
.obsolete(provider, region_id, last_entry_id)
.await
.map_err(BoxedError::new)
.context(DeleteWalSnafu { region_id })
@@ -142,7 +142,7 @@ impl<S: LogStore> Wal<S> {
provider: &Provider,
) -> Result<()> {
self.store
.obsolete(provider, last_id)
.obsolete(provider, region_id, last_id)
.await
.map_err(BoxedError::new)
.context(DeleteWalSnafu { region_id })

View File

@@ -168,6 +168,7 @@ mod tests {
async fn obsolete(
&self,
_provider: &Provider,
_region_id: RegionId,
_entry_id: EntryId,
) -> Result<(), Self::Error> {
unreachable!()