-
Notifications
You must be signed in to change notification settings - Fork 110
Description
I have a hacked up copy/paste/extraction of the lazyFile in this project put into my test lab project. I think it's possible there's a bug upstream here where the speed stuff and using the rangemapper functionality with split db chunks can sometimes result in the rangeMapper being called with absolute bytes that span server DB chunks. The reasoning for this is that the head/speed stuff can sometimes increase the next read to span the DB chunks and the rangemapper would not be able to properly map a URL.
I'm sorry, my stuff is so hacked up, that by all means, if you want to just close this, I'm fine with that since this is one of those crazy downstream people hacking it too far sort of issues. I did try to fix it and this commit of mine seems to do it. It will not try to call rangemapper with something itself could not resolve as lazyFile is now aware of the serverChunkSize and will not speedup if the next wantedChunk spans to another DB chunk.
Here's the commit:
nelsonjchen/datasette-lite@ccdc574
Without this, it seems to try to get something from the 11MB mark of a 10MB chunk for my project which I've fixed:
This commit itself may be buggy, but I just wanted to note this here. I'm 80% certain this isn't handled at the higher level SQLite worker and that this issue could still happen with this project's lazyFile. I'm only using this project's lazyFile, but I'm pretty sure my use of it would be similar to this project's sqlite worker.
My guess on the best way to reproduce this is to probably try to do many reads of a contiguous block near the end of a server chunk boundary until the speedup results in rangeMapper being called with something that it could not return a reasonable from, to and url structure where to is beyond the file size of the server chunk.