View Single Post
Old 03-13-2025, 06:31 PM   #58
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,820
Karma: 30277270
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by PeterT View Post
I wonder if using Process Monitor from SysInternals might provide some insight into file activity
Been there, done that, see the log in OP's post #33 -

Quote:
Originally Posted by sgmoore View Post
What sort of changes are you doing?

I got hit with an issue where I tagged a book without looking at what I was typing and without realising that my capslock was on. So the book ended up being tagged mYSTERY instead of Mystery.

Calibre then spent a long time updating the opf files for all the other books that had been tagged as Mystery to make them all say mYSTERY

So sometimes updating one book can affect lots of other records.
Mass updates to metadata.opf files are done via a separate background process… slowly, can take minutes, hours, days even, and if you close calibre, next time it starts it will carry on updating them regardless.

And it's not just Tags, it's any column e.g. Comments; no casing issues there or triggering of mass metadata backup writes.

Quote:
Originally Posted by DNSB View Post
Wouldn't the issue as suggested by sgmoore's example of having caps lock on be a one shot issue. After the change was made and everything was updated, that slowness would disappear unless something was triggering a change on every startup.
The list from Process Explorer in Safe Mode, where the problem persists, suggests not… and its almost identical to me doing the same on my system.

Quote:
Originally Posted by theducks View Post
I would think so.
OP have you looked at the file timestamps for metadata.opf in the book folder?
That might give a clue if these books are stuck in some weird update loop.
Does anyone know where the 'dirty' flag is kept? Maybe that is RO
Snippet from Process Monitor log, only one book gets its metadata backup written, duration is the last column, as I already said it's diddlysquat… 0.002 secs.

Code:
10:53:50.60	calibre.exe	12148	WriteFile	D:\NOV 2022 CALIBRE LIBRARY\Otto Carius\Tigers in the Mud (1261)\metadata.opf	SUCCESS	Offset: 0, Length: 1,030, Priority: Normal	0.0001689
10:53:50.60	calibre.exe	12148	WriteFile	D:\NOV 2022 CALIBRE LIBRARY\Otto Carius\Tigers in the Mud (1261)\metadata.opf	SUCCESS	Offset: 0, Length: 4,096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal	0.0012767
10:53:53.24	calibre.exe	12148	WriteFile	D:\NOV 2022 CALIBRE LIBRARY\Otto Carius\Tigers in the Mud (1261)\metadata.opf	SUCCESS	Offset: 0, Length: 1,108, Priority: Normal	0.000089
10:53:53.24	calibre.exe	12148	WriteFile	D:\NOV 2022 CALIBRE LIBRARY\Otto Carius\Tigers in the Mud (1261)\metadata.opf	SUCCESS	Offset: 0, Length: 4,096, I/O Flags: Non-cached, Paging I/O, Synchronous Paging I/O, Priority: Normal	0.0007957
The 'dirty' flag is in the database, in a table named metadata_dirtied:

Code:
CREATE TABLE metadata_dirtied(id INTEGER PRIMARY KEY,
                             book INTEGER NOT NULL,
                             UNIQUE(book))
BR

Last edited by BetterRed; 03-13-2025 at 06:49 PM.
BetterRed is offline   Reply With Quote