![]() |
#16 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
There is no relationship between the cache and calibre's database. It is normal that the database is out of sync with the cache because it is normal that calibre is out of sync with the device. |
|
![]() |
![]() |
![]() |
#17 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
|
![]() |
![]() |
![]() |
#18 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
So, I synced my phone last night, and I just synced again from the same computer this morning. CC is currently sending the metadata for 5300 books to Calibre. I made no global changes in Calibre. and didn't change any settings in CC. I don't know why it thinks it needs to send anything, much less the metadata for 5300 books.
I just sent you a debug log so you could take a look at why it was doing it. |
![]() |
![]() |
![]() |
#19 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
1) You connected at 2014-10-09 01:35:15. This connection sent metadata for 21 books. Clearly the cache worked. 2) You connected again at 2014-10-09 22:54:27. This connection sent metadata for 66 books. Again, the cache worked. 3) You connected again at 2014-10-10 11:50:49. This connection sent metadata for 5293 books. Here, something either went wrong or a lot of books were changed in non-obvious ways. So, the question is "what happened between 10:54 pm on the 9th and 11:50 am on the 10th?" Do you remember what you might have done? I am looking for something that either messed with the driver's cache (unlikely) or changed the mod time for more than 5000 books. For example, might you have changed a tag used in lots of books? Could you have changed something like a publisher, used everywhere? Any clues? We know that the cache file wasn't deleted or corrupted, because if it was then metadata for more than 6,000 books would have been sent. This means that calibre thinks that the mod time for more than 5,000 books changed. I am assuming that the disk containing the cache is not out of space. |
|
![]() |
![]() |
![]() |
#20 |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
I'm not 100% sure how this works. I have "Sync only from Calibre to CC" set, so I don't see how anything I do on the CC side could invalidate the device cache on the computer. Do changes in the calibre side force CC to send over its metadata again? Do you update based on modified date, or by comparing the two side's metadata?
In any case, I went to sleep last night after doing a sync, and I got up this morning, added a book to my library, and did another sync. I didn't do any metadata change on the Calibre side that would impact 5300 books. Except for a couple of books, I didn't make any metadata changes at all. I might have deleted a dozen or so non-epub metadata files. I just checked to be sure, and I don't have any custom column definitions that change their value automatically based on date or anything like that. I have plenty of free space on my drive. Last edited by kaufman; 10-10-2014 at 08:03 PM. |
![]() |
![]() |
![]() |
#21 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Overnight I had an idea. Do you have more than one library? And do these libraries share content? And if so, did you switch to that other library while connected? The reason to ask: when you switch libraries while connected, calibre goes through the book matching process for the books on the device and changes the cache. I can't see how this would break things, but I thought I would ask. The only ways I can see that would really break the cache are: - If two devices with the same unique ID connect to the same library. I don't see a way that this can happen. - If the cache file is being altered somehow. Again, I don't see why this could happen. - If there is a problem encoding data to write into the cache file. If this happens then the cache would be cut off at the book with the problem. There would also be a message in calibre's debug log, but you wouldn't ever see that unless you always run in debug mode. One experiment that is worth trying when you feel like it. Make sure calibre is not running even in the tray, then go to ~/Library/Caches and delete all files of the form wireless_device_{long_string_of_digits}_metadata_c ache.json. Start calibre, then connect your device. It will send all metadata because the cache is empty. Disconnect, quit calibre, then look in that folder. There should be one file wireless_device... , and it should be very long. Restart calibre in debug mode, then connect. CC should send no metadata. Disconnect. The mod time on the file will change. Its length might change slightly. This experiment will show us if something basic is broken. If everything works as described then we know that calibre and CC are agreeing on the contents of the cache. If CC sends metadata then something has gone wrong, and I hope that calibre's debug log will tell me. Send me that debug log by email. Thanks for your patience and for your help! |
|
![]() |
![]() |
![]() |
#22 | |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Quote:
It is currently sending the metadata for 1923 books. Bingo. I'm happy to try the other tests you mentioned, but perhaps you don't need me to any more. My pleasure. Always glad to help. |
|
![]() |
![]() |
![]() |
#23 | |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Quote:
Is this even possible? If so, does it require CC changes, or are you sending over the book modification dates anyhow? |
|
![]() |
![]() |
![]() |
#24 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Could you do the same experiment while running calibre in debug mode? That might give me enough info to figure out what is happening. You would end up making two logs. Might as well send me the CC debug log as well, just in case. Again, thanks. |
|
![]() |
![]() |
![]() |
#25 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
What I could do is add an "Ask on connect" option to CC. If set, CC would pop up a dialog when you tap "Connect as wireless device" asking you if you want to sync books during this connect. |
|
![]() |
![]() |
![]() |
#26 | |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Quote:
You could also make it a check box on the connect dialog. |
|
![]() |
![]() |
![]() |
#27 | |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Quote:
Running tests now. |
|
![]() |
![]() |
![]() |
#28 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
I did it without adding an option. Instead I changed the meaning of the existing option to show another line on the connect menu. These screen captures show what it looks like. |
|
![]() |
![]() |
![]() |
#29 | |
Calibre Companion Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
|
Quote:
Still running the tests. Messed up the first time and then had to make breakfast for the kids. EDIT: Logs sent. Last edited by kaufman; 10-11-2014 at 12:51 PM. |
|
![]() |
![]() |
![]() |
#30 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,460
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
When a device disconnects, calibre writes the metadata cache file to the disc, a process that can take some time if there are a lot of books on the device. For example, for Kaufman with some 6,000 books on the device, writing the cache took around 10 seconds. The write is done in the background as part of the disconnect sequence. The problem is that if the user quits calibre while this write is happening then the write process is killed, leaving the cache with an indeterminate number of entries. If is of course perfectly reasonable to quit calibre after disconnecting, especially as it doesn't indicate that it is busy doing something. I needed to find a way to ensure that quitting "early" doesn't corrupt the cache. After some discussion with Kovid, I made two changes. The first is to write the cache after metadata is sent to CC, ensuring that the cache file is always "close-to" up-to-date. The second is to write the information to a tmp file then replace the existing cache with that file. This guarantees that the cache is either fully replaced or not touched. Both of these changes are in calibre source now and will be in the next calibre release. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
That's an improvement! | caheaton | Kobo Reader | 8 | 04-11-2011 01:04 PM |
call for testers from source: dramatic performance improvement | chaley | Calibre | 3 | 12-15-2010 09:45 AM |
Wireless internet connection frustrating IDS connection | Socrates | iRex | 8 | 10-21-2009 12:46 PM |