AISI — synchronization
This page explains how a sync keeps an index in step with its storage: what a sync is made of, how each kind of storage reports its changes and how fresh the index can be expected to be, full scans (snapshots), renames and moves, how far a sync follows its source (its mode), deletions and the mass-deletion hold, pausing, and what happens to a sync's documents when the sync is deleted. Setting up push and queue notifications is in push and queue notifications. Watching AISI and dealing with failures is in operations. Who may do what is in security and governance.
1. What a sync is
A sync reads one part of one storage connection and feeds one index. It is created in AISI → Syncs → New sync by someone with AISI Manage configuration. The wizard opens on its own page, with its steps listed beside it and a running summary. It has seven steps:
| Step | Field | Means |
|---|---|---|
| Connection | Storage connection, Name | where the files live. The connection must be enabled. The name is unique in the tenant |
| Scope | Folder (and, for S3, SQS queue URL) | the folder under the connection's root, drive or bucket. Empty takes everything |
| Filters | Include patterns, Exclude patterns | which files in the scope are taken (below) |
| File types | extensions such as pdf, docx. Empty takes every type AISI can extract |
|
| Largest file (MB) | files above it are left out. Empty uses the platform limit, 1 GB (AISI__PROCESSING__MAXFILESIZEBYTES); a sync may only set a lower one |
|
| Reconcile every (days) | a periodic full rescan, every 1 to 365 days. Off unless you set it, and costly on a large storage: see §4 | |
| Concurrency override | how many of the sync's documents are processed at once. Empty uses the connection's limit, 4 (AISI__PROCESSING__MAXCONCURRENTPERCONNECTION); a sync may only set a lower one |
|
| Index | Index | where the documents are written |
| Sync mode | Sync mode | how far the source is followed: whether a document is updated when it changes, and removed when it is deleted (§6). Full sync by default |
| Deletion grace period (seconds) | how long a deletion waits before it applies (§6), on a Full sync. The wizard proposes 300 seconds | |
| Change notifications | Change notifications, Poll every (minutes) | how changes are noticed (§2) |
| Review | — | nothing is saved until this step. Saving starts the sync's first snapshot |
The connection and the index are fixed once the sync exists. To read elsewhere or feed another index, create another sync. Everything else can be changed on the sync's page (select the sync in the grid and choose Open sync), on the tabs Name & scope, Filters, Sync mode and Change notifications, and saved with Save changes.
Patterns are globs over the document's path, as Documents shows it:
*matches within one folder level,**across levels,?one character.- A pattern without a slash matches the file name wherever it is:
*.tmp. - A pattern with a slash matches the whole path:
archive/**. A folder pattern also takes what lies under it. - Matching ignores case.
- Excludes are applied after includes.
**/~$*skips Office lock files. - Each list holds at most 100 patterns of at most 512 characters.
Filters apply when a change is recorded, not at the storage. Tightening them turns indexed documents that no longer match into deletions (on a sync that follows the source, §6); widening them takes in files no change will ever announce. So a change to the scope or the filters starts a full scan (§4) that finds both, and so does switching a sync to Full sync. Changing only the name or the notification mode does not.
2. How changes are noticed
Every sync is checked by the worker on a schedule. What a check does depends on the storage:
| Storage | A check | Modes offered |
|---|---|---|
| SFTP, FTP, FTPS | lists every folder and compares it with what is indexed | Polling |
| S3 and S3-compatible | lists every key prefix and compares it with what is indexed | Polling; Push (MinIO); Queue (SQS) |
| Microsoft Graph (OneDrive, SharePoint) | reads the drive's change feed from where the last check stopped | Polling; Push |
| Google Drive | reads the drive's change feed from where the last check stopped | Polling; Push |
- Comparing listings costs a listing of every folder in scope at each check. An unchanged tree writes nothing.
- Change feeds return only what changed since the last check, so a check of a quiet drive is cheap however large the drive.
- A large backlog is read in slices. One check stops after 5,000 changes (
AISI__CHANGETRACKING__MAXEVENTSPERTICK) or 2 minutes (MAXTICKDURATION), and the next starts at once from where it stopped. - Changed files start processing at once. They do not wait for a schedule.
The Change notifications setting chooses how checks are triggered. Automatic, Polling, Push and Queue, and what each storage needs for them, are described in choosing a mode on a sync.
Freshness to expect
| Mode | A change is noticed | Safety net |
|---|---|---|
| Polling | at the next check: within Poll every (minutes), plus up to a minute for the scheduler (AISI__CHANGETRACKING__TICKSCHEDULERINTERVAL) |
— |
| Push | within seconds of the storage's notification | a check every hour on its own (AISI__CHANGETRACKING__PUSHSAFETYPOLLINTERVAL) |
| Queue | when the queue is next read, every Poll every (minutes) | a full listing comparison every hour, within those reads |
Poll every (minutes) defaults to 5 (AISI__CHANGETRACKING__DEFAULTPOLLINTERVAL). It may be 1 minute to 7 days, and
not below the deployment's floor, 1 minute by default (MINPOLLINTERVAL).
- Push wakes a sync for the whole drive. Microsoft and Google notify for any change in the drive, so a sync scoped to one folder is checked when something elsewhere changes. The check finds nothing in its folder and writes nothing.
- A sync whose notifications stop working polls at its own interval, and says so. See when notifications are unavailable.
- The time from a change to its document being searchable also includes processing: fetching, extracting and, where
the index asks for them, OCR and summaries.
aisi_change_lag_secondsmeasures it end to end; see what to watch.
The sync's summary panel (select it on AISI → Syncs) shows Last checked, Next check and Last change seen; the Overview tab of its page also shows, for a sync not set to Polling, Last notification. AISI → Activity shows every sync under Syncs:
- Following changes — how the sync learns of changes, its state, and what is wrong when something is.
- Last check — when, and what it did: Up to date, Catching up (another batch follows at once), Failed or Slowed down by the storage; after two failures in a row, how many.
- Documents — the sync's documents by where they stand: indexed, waiting (queued, being processed or waiting for the token budget), retrying, failed, quarantined, skipped and being removed. Each count opens Documents filtered to the sync, and to the state when the count is a single one.
- Changes applied — the files added, changed, moved and removed since the sync was created, and when the last change arrived.
When a check fails
A check that cannot read the storage (refused credentials, an unreachable server, a missing root folder) marks the sync Failing and notifies once: Sync cannot read its source. A connection problem also marks the connection Unhealthy. Nothing is deleted. The check is retried after the poll interval, then at doubling intervals up to one hour. The sync returns to normal at the first check that succeeds.
A storage that asks AISI to slow down pauses its whole connection for the time it gives; see throttling.
3. Collect now
Collect now (on the sync's summary panel or its page, AISI Operate) brings the sync's next check forward to now. Use it after a change at the source that should not wait for the schedule, or after fixing the cause of a Failing sync.
- It reads changes the normal way. It is not a full scan.
- It is disabled while the sync is paused: Resume the sync first.
- While a snapshot is running, it makes the snapshot's next slice run now.
4. Snapshots
A snapshot reads everything in the sync's scope once, compares it with what is indexed, and queues what is new or changed. Unchanged documents are not processed again. At its end, the indexed documents it did not find are deleted (§6) — on a sync that follows the source; a sync in another mode keeps them.
Why a snapshot runs. Activity and the sync's Snapshot tab say why, in the Why column:
| Why | Started by |
|---|---|
| First full scan | creating the sync |
| Resync requested by an operator | Resync on the sync's summary panel or its page (AISI Operate) |
| Resync requested by the source | the storage: its change feed can no longer be continued, for example a Microsoft Graph or Google Drive position that expired. AISI starts the snapshot on its own |
| Scope, filters or mode changed | saving a change to the sync's scope or filters, or switching it to Full sync (§1) |
| Scheduled reconciliation | Reconcile every (days), below |
Reconcile every (days) rescans the whole scope on a schedule. It is off unless you set it, and the Portal asks you to confirm the cost when you set or change it:
- A rescan lists every item in the scope. On a storage with millions of documents it can run for hours, occupies a worker, and spends the storage provider's API quota -- OneDrive, SharePoint and Google Drive throttle heavy use, and S3 bills every listing request. Unchanged documents are not processed again, so the cost is the listing itself.
- It is rarely needed. Change notifications and change feeds keep the index current; a rescan only catches what they missed. Consider it for a sync that relies on push or queue notifications and must not drift, with an interval of weeks rather than days.
- When it runs. At the sync's next check after its last full scan of any kind -- the first scan, a Resync, a configuration change or an earlier reconciliation -- is older than the interval. Turning it on for an old sync can therefore start one at once. It runs like any snapshot: one at a time, shown in Activity, cancellable, and on a sync that follows the source it removes what it did not find, under the deletion guard (§6).
- Clearing the field turns it off.
Only one snapshot runs per sync. Resync is refused while one is running (A snapshot is already running for this sync.) or while one waits for a decision on held deletions (A snapshot is waiting for its held deletions to be approved or discarded.). A scope or filter change saved while a snapshot runs starts none: run Resync once the running one has finished.
How it runs. A snapshot reads in slices, like a check, and keeps its place between them. Change checks for the sync wait until it ends.
- On a change-feed storage (Microsoft Graph, Google Drive), the snapshot ends where the change feed resumes, so the first check after it reads only what changed since.
- On a listing storage, the next check compares listings afresh.
- If the storage becomes unreachable, the sync is Failing and the snapshot waits. It continues from where it was once the storage answers again. A snapshot never ends as failed: it completes, or you cancel it. If Microsoft Graph or Google Drive no longer accepts its position, the listing starts over inside the same snapshot, keeping what it had seen.
What a snapshot did shows in Activity → Snapshots, under Result: how many files it found and what it changed — 454 items found · 454 new, or 454 items found · no changes for a resync that found nothing to do. Unchanged files are not indexed again, so such a snapshot queues nothing.
The scan usually finishes well before the files it queued are indexed. Until they are, Result shows a bar of the documents indexed so far, also on a Completed snapshot; then it says how they ended: indexed, failed (quarantined, or given up on after the last retry) or skipped (a property of the file — its type, its size, a password — kept it out, or it was removed first). A failure still being retried is not counted until it ends. Took is how long the scan itself ran.
Selecting a snapshot in Activity → Snapshots shows its counts in the summary panel beside the list: Items found, New, Changed, No longer in storage, Queued to index, Indexed, Failed, Skipped. When it ends, AISI notifies Snapshot completed with the counts, or Deletions held for approval (§6).
Cancel snapshot
Cancel snapshot (Activity → Snapshots: select a Running one and choose it in the summary panel, AISI Operate) stops it after its current batch:
- What it has already queued is still indexed.
- Nothing is deleted for not having been seen: a cancelled scan proves nothing is missing.
- The snapshot shows Canceled.
What follows depends on the storage. A listing storage compares listings afresh at its next check. Microsoft Graph reads its change feed from the beginning. Google Drive follows its change feed from the moment the cancelled snapshot began, so changes made while it ran are not missed; files the snapshot had not reached yet are indexed when they next change, or by a Resync. No new snapshot starts on its own.
5. Renames and moves
A rename or a move that AISI recognizes keeps the document: its path and name change in the index, and its content is not fetched or extracted again.
| Storage | How a move is recognized |
|---|---|
| Microsoft Graph, Google Drive | every item has an id that survives renames and moves. A moved folder takes every document under it along |
| SFTP, FTP, S3 | within one check, by the same checksum (S3), the same name, size and modification time anywhere in the scope, or a unique file in the same folder with the same size, modification time and extension (a rename in place) |
- A move that is not recognized is seen as a deletion and a new file. The file is indexed again at its new path, and its old entry is removed after the grace period — on a sync that follows the source; otherwise the old entry stays.
- On an Index only sync a recognized move still updates the document's location, so the file is not indexed a second time at its new path. Nothing else about the document changes.
- Moving out of the scope is a deletion. Moving in is a new file. On Microsoft Graph and Google Drive, a folder moved into the scope is listed at once, because the change feed does not list what it holds.
- Google Docs and Sheets have no checksum, so renaming one exports it again. They are indexed as
.docxand.xlsx(BudgetbecomesBudget.docx), and file-type filters see those extensions. Google Slides are not supported: a sync leaves them out.
Renaming or moving the sync's own folder does not delete anything. The sync reports that its source cannot be read until the folder is back, or until the sync's Folder is changed to the new location.
6. Deletions
How far a sync follows its source
Every sync has a sync mode, set when it is created and changed on the Sync mode tab of the sync's page:
| Mode | New file | Changed file | Deleted at the source, or no longer in the sync's scope or filters |
|---|---|---|---|
| Full sync (the default) | indexed | indexed again | removed from the index, after the grace period and under the mass-deletion hold |
| Create/update | indexed | indexed again | stays indexed |
| Index only | indexed | left as it was indexed | stays indexed |
- The grace period and the mass-deletion hold apply only to Full sync. The other modes never delete, so there is nothing to hold.
- On Index only, a document is never touched again once indexed. The one exception is a recognized rename or move (§5): its location is followed so that the file is not indexed twice.
- Switching a sync to Full sync starts a full scan (Scope, filters or mode changed, §4). It finds the documents deleted at the source while the sync was in another mode, and removes them under the mass-deletion hold.
- A mode that never removes documents is the way to keep an archive of what once was in the storage. To load a storage's current documents once and stop, see Deleting a sync.
The rest of this section applies to a Full sync.
The grace period
A file that disappears from the source is not removed from the index at once. Its document becomes Pending deletion and waits for the sync's Deletion grace period. If the file reappears within it unchanged, at the same path, the document returns to its previous state without being processed again. This absorbs editors that save by deleting and rewriting a file.
- The grace period may be 0 seconds to 7 days.
- A document that never reached the index becomes Deleted at once: there is nothing to remove.
- During the grace period, the document stays searchable.
Nothing is deleted on doubt
- A storage root that cannot be reached deletes nothing. The sync is Failing and says why.
- A subfolder that cannot be read is skipped and deletes nothing.
- An S3 folder that has been emptied reads exactly like one that is gone, because S3 has no folders, only key prefixes. The sync reports its source unavailable, and its documents stay indexed. Remove them with Exclude patterns (§1), or delete the sync and remove its documents (§8).
- A cancelled snapshot deletes nothing (§4).
The mass-deletion hold
When a sync would delete an unusually large share of its documents at once, AISI holds the deletions for a person to decide. A folder that disappeared, a renamed root or a credential that suddenly sees an empty folder all look, to a listing, exactly like the documents having been deleted.
Deletions are held when, within one hour (AISI__DELETION__DELETIONHOLDWINDOW) or at the end of one snapshot, they
are:
- more than 20 % of the sync's indexed documents (
AISI__DELETION__MASSDELETIONTHRESHOLDPERCENT), and - at least 100 documents (
AISI__DELETION__MASSDELETIONMINIMUMCOUNT).
While deletions are held:
- Held documents stay indexed and searchable.
- Once tripped, the hold holds every further deletion of the sync until someone decides, so approving the first half of a mass deletion never lets the second half through unattended.
- The sync keeps running. New and changed files are indexed as usual.
- A snapshot that found them shows Deletions held, and Resync is refused until the decision.
- AISI notifies Deletions held for approval and records it in the audit log. The sync shows N deletions held on the Syncs grid, a banner leads the Activity screen, and the sync appears under Syncs needing attention on the overview.
Someone with AISI Operate decides, on the banner in Activity or on the Overview tab of the sync's page. The sync's summary panel on Syncs shows the hold with Decide in Activity →:
| Action | Effect |
|---|---|
| Approve deletions | the held documents are removed from the index now, without a further grace period |
| Discard deletions | the held documents stay indexed, in the state they were in. A later snapshot that still does not find them proposes their deletion again |
Both ask for confirmation and state the number of documents. Before deciding, find out why the files disappeared: most mass deletions are not real. Check the storage itself, not AISI, for:
- a server or bucket that answered with an empty listing;
- a root folder renamed or moved;
- an account that lost access to part of the tree;
- a bucket prefix or a drive changed by someone else.
If the files are really gone (a planned clean-up), approve. If they are not, fix the storage first, then discard: the next check finds the files where they are. A snapshot waiting on the hold completes with either decision. Never approve just to clear the banner: approved documents leave the index at once, and if the files come back they are indexed again from scratch.
7. Pausing and resuming
Pause sync (AISI Operate, on the sync's summary panel or its page) asks for a Reason, which the next operator reads on the Syncs grid. A paused sync:
- is not checked, and its pending documents are not processed;
- keeps its push or queue notifications registered, so resuming needs no new setup;
- keeps everything it indexed searchable;
- shows Paused in the Changes column.
Resume sync checks it at once and continues in the state it was in, including a snapshot it was running. Changes made at the source while it was paused are found by that check: a change feed resumes from its position, and a listing comparison sees the current state.
Paused by AISI: credentials refused
When the storage refuses a connection's credentials (SOURCE_AUTH_FAILED), AISI pauses every sync of that
connection at once, instead of trying the same login again on every check and every document: on an SFTP or FTP
server, repeated failed logins can lock the account. The Portal tells you which syncs were paused, and their note reads
The storage refused the connection's credentials. Nothing is deleted, and everything indexed stays searchable.
They resume on their own, and are checked at once, when either:
- the connection's secrets are saved (on the connection's page, or in Secrets), or
- a test of the connection succeeds: your Test connection, or the health check AISI runs every 15 minutes.
A sync you paused yourself is never resumed this way, and you can still Resume sync by hand.
A mass-deletion hold is different: it never pauses the sync. New and changed documents keep being indexed while the held deletions wait for your decision (§6).
8. Deleting a sync, and disabling a connection or an index
Deleting a sync
Delete sync (AISI Manage configuration, on the sync's summary panel or its page) asks what becomes of the documents the sync indexed:
- Keep its documents indexed (preselected) — the documents stay indexed and searchable, detached from the sync.
- Remove its documents from the index — each document's searchable units are deleted from the index, then its record in AISI.
Either way the sync stops at once and disappears from the Syncs grid. Its push subscriptions are removed from Microsoft and Google. MinIO targets and SQS queues are yours and are left as they are. The storage itself is never touched.
The worker then finishes the job in the background. It first waits until no document of the sync is being processed and the push or queue subscription at the provider has been removed — at most 24 hours — and then works through the documents in batches.
When the documents are kept:
- Each indexed document becomes an orphan: it stays in the index with what it had, is detached from the sync, and is never processed again. Documents shows it as Orphaned, with the name of the deleted sync.
- A deletion already decided at the source is completed: that document is removed.
- Deletions held by the mass-deletion hold (§6) are discarded, and those documents kept.
- A document that never reached the index has nothing to keep, and is removed.
An orphan is removed one at a time with Remove from index on the Documents screen (AISI Manage configuration), or all at once by deleting its index (disabling and deleting an index).
Indexing a storage once. To load what a storage holds today and not follow it afterwards — a migration, an archive of a share about to be retired — create a sync, let its first snapshot complete and its documents be indexed, then delete the sync and keep its documents. They stay searchable as orphans. A document still waiting to be indexed when the sync is deleted is not kept.
A sync being deleted still counts as using its storage connection until the worker has finished with it, so the connection cannot be deleted before then. It does not prevent its index from being deleted: the index's deletion waits for it.
Disabling a connection or an index
There is no switch to disable a sync on its own; pause it (§7). Disabling what a sync uses also stops it, without removing anything:
| Disabled | The sync |
|---|---|
| the storage connection | is not checked, and its documents are not processed. Nothing is recorded as a failure. A new sync cannot be created on it |
| the index | keeps being checked and records changes, but its documents wait unprocessed until the index is enabled again |
In both cases, what is already indexed stays searchable.