aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/reader_cache.go
AgeCommit message (Collapse)AuthorFilesLines
2023-01-16use one readerCache for the whole filechrislu1-1/+1
2023-01-14avoid index out of slice rangechrislu1-1/+1
2023-01-02more solid weed mount (#4089)Chris Lu1-3/+4
* compare chunks by timestamp * fix slab clearing error * fix test compilation * move oldest chunk to sealed, instead of by fullness * lock on fh.entryViewCache * remove verbose logs * revert slat clearing * less logs * less logs * track write and read by timestamp * remove useless logic * add entry lock on file handle release * use mem chunk only, swap file chunk has problems * comment out code that maybe used later * add debug mode to compare data read and write * more efficient readResolvedChunks with linked list * small optimization * fix test compilation * minor fix on writer * add SeparateGarbageChunks * group chunks into sections * turn off debug mode * fix tests * fix tests * tmp enable swap file chunk * Revert "tmp enable swap file chunk" This reverts commit 985137ec472924e4815f258189f6ca9f2168a0a7. * simple refactoring * simple refactoring * do not re-use swap file chunk. Sealed chunks should not be re-used. * comment out debugging facilities * either mem chunk or swap file chunk is fine now * remove orderedMutex as *semaphore.Weighted not found impactful * optimize size calculation for changing large files * optimize performance to avoid going through the long list of chunks * still problems with swap file chunk * rename * tiny optimization * swap file chunk save only successfully read data * fix * enable both mem and swap file chunk * resolve chunks with range * rename * fix chunk interval list * also change file handle chunk group when adding chunks * pick in-active chunk with time-decayed counter * fix compilation * avoid nil with empty fh.entry * refactoring * rename * rename * refactor visible intervals to *list.List * refactor chunkViews to *list.List * add IntervalList for generic interval list * change visible interval to use IntervalList in generics * cahnge chunkViews to *IntervalList[*ChunkView] * use NewFileChunkSection to create * rename variables * refactor * fix renaming leftover * renaming * renaming * add insert interval * interval list adds lock * incrementally add chunks to readers Fixes: 1. set start and stop offset for the value object 2. clone the value object 3. use pointer instead of copy-by-value when passing to interval.Value 4. use insert interval since adding chunk could be out of order * fix tests compilation * fix tests compilation
2022-08-26nano level precisionchrislu1-2/+2
2022-08-26Fix a few data races when reading files in mount (#3527)Patrick Schmidt1-19/+26
2022-08-24Fix race conditions during in-flight size checks (#3505)Patrick Schmidt1-1/+1
2022-08-21Fix hanging reads in chunk cacher (#3473)Patrick Schmidt1-33/+34
Sometimes when an unexpected error occurs the cacher would set an error and return. However, it would not broadcast the condition signal in that case, therefore leaving the goroutine that runs readChunkAt stuck forever. I figured that the condition is unnecessary because readChunkAt is acquiring a lock that is still held by the cacher goroutine anyway. Callees of startCaching have to wait for a WaitGroup which makes sure that readChunkAt can't acquire the lock before startCaching. This way readChunkAt can execute normally and check for the error.
2022-07-29move to https://github.com/seaweedfs/seaweedfschrislu1-3/+3
2022-07-15mount: fix bug during busy writeschrislu1-1/+10
fix https://github.com/chrislusf/seaweedfs/issues/3315
2022-07-13Avoid fatal error: sync: Unlock of unlocked RWMutexchrislu1-3/+3
fix https://github.com/chrislusf/seaweedfs/issues/3306
2022-07-08mount: fix racing conditionschrislu1-0/+7
prevent wrong reading when the SingleChunkCacher is started, but not finished yet
2022-03-04mount: avoid possible index out of bounds errorchrislu1-1/+5
2022-02-26prefetch other chunks when stream readingchrislu1-26/+30
2022-02-26remove logschrislu1-3/+0
2022-02-26better control for reader cachingchrislu1-0/+187