You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repeatedly creating and dropping an index grows the database file by about 16 KB per cycle #209
10,000 cycles of CreateIndexAsync + DropIndexAsync on a typed collection grow the file from about 2 MB to about 166 MB. Found while testing #196; it happens on main the same way, so it isn't the metadata chain.
CollectionIndexManager.DropIndex frees the tree with FreeAllPages (CollectionIndexManager.cs:282-292). Two likely causes, not yet confirmed:
or some pages of the dropped tree aren't reached by CollectAllPages.
Repro sketch
for(inti=0;i<10_000;i++){awaitdb.PeopleV2.CreateIndexAsync(p =>p.Name,"idx_tmp");awaitdb.PeopleV2.DropIndexAsync("idx_tmp");}// compare file size before and after; then CheckpointAsync() and compare again
Expected
After a checkpoint, the pages of the dropped indexes are reused and the file stops growing. If the growth disappears after a checkpoint, it's the deferred-free queue and only needs a size or count trigger for the checkpoint; if it doesn't, pages are leaking.
Activity