LiteDB icon indicating copy to clipboard operation
LiteDB copied to clipboard

Update MemoryCache.cs

Open rainman-306 opened this issue 3 years ago • 1 comments

When readable page is updated from a writable page buffer, the ShareCounter was set to 1 before it is copied, but when writable page is discarded the Ensure will throw an exception because the ShareCounter isn't set to BUFFER_WRITABLE.

rainman-306 avatar Aug 26 '22 12:08 rainman-306

@mbdavid Can this fix be merged and released please? We are facing this issue with our product in production.

snarayanapura avatar Aug 29 '22 15:08 snarayanapura

@mbdavid Can this fix be merged and released please? We are facing this issue with our product in production.

Jyoti1682 avatar Nov 09 '22 13:11 Jyoti1682

@mbdavid Can this fix be merged and released please? We are facing this issue with our product in production.

In LiteDB.Constants.ENSURE(Boolean conditional, String message) In LiteDB.Engine.MemoryCache.DiscardPage(PageBuffer page) In LiteDB.Engine.DiskService.DiscardDirtyPages(IEnumerable1 pages) In LiteDB.Engine.TransactionService.Rollback() In LiteDB.Engine.LiteEngine.AutoTransaction[T](Func2 fn) In LiteDB.LiteCollection`1.Insert(T entity) In Acctrue.PrintApp.Infrastructure.TaskJob.LiteDBTaskHandler.OnAdd(TaskInfo task) 在 E:\Work\Git\PrintAppDev\PrinterApp\PrintApp.Infrastructure\TaskJob\LiteDBTaskHandler.cs : 42 Line 在 FreeScheduler.Scheduler.AddTaskPriv(TaskInfo task, Boolean isSave)

图片

sgf avatar Nov 16 '22 13:11 sgf

@mbdavid Can this fix be reviewed and merged, please? We are also facing this issue in our production environment. There is another similar bug raised for this issue - https://github.com/mbdavid/LiteDB/issues/2184

Thank you!

surajitkarmakar avatar Dec 12 '22 15:12 surajitkarmakar

@mbdavid We are facing the same issue with our production on multiple devices. Once this issue is faced, the only option is to delete and recreate the database, which is making things really difficult for us. Can we please review and merge this fix?

davisannie avatar Dec 12 '22 15:12 davisannie