- 13 Apr, 2020 1 commit
-
-
Steven Allen authored
* Use a map for dirsToSync to avoid syncing the same dir multiple times. * Keep track of files in a slice, and use offsets into the slice to keep track of which ones have been closed/removed. Also, record the fact that we've created a temporary file _before_ we try to write to it, in case the write fails. That way, we'll try to remove it when we abort.
-
- 10 Apr, 2020 6 commits
-
-
Steven Allen authored
Instead of retrying in get only, retry everywhere we read a file.
-
Steven Allen authored
When multiple write operations conflict, we: 1. Try them in-order till one succeeds. 2. After the fact, re-order them such that the pending operations "happen" after the one that succeeds. 3. Return "success" for all the pending write operations for that key. This is acceptable because we're claiming that the operation that _actually_ succeeded happened "last" so it would have clobbered the other operations. However, in the case of put, we still need to remove the temporary file that we didn't end up moving into place.
-
Will authored
add fd-overload retries inline
-
Steven Allen authored
-
Steven Allen authored
-
Will Scott authored
-
- 09 Apr, 2020 2 commits
-
-
Will Scott authored
-
Will Scott authored
-
- 31 Mar, 2020 2 commits
-
-
Steven Allen authored
Otherwise, if we repeatedly stop the same node, we'll collect a bunch of temporary files and NEVER DELETE them. This will: 1. Waste space. 2. Slow down queries/GC. This patch: 1. Moves all temporary files to a single `.temp` directory. The leading `.` means it can't conflict with any keys and queries (even on older flatfs versions) will skip it. 2. Adds an "rm -rf flatfs-dir/.temp" call on start.
-
Steven Allen authored
We _expect_ temporary put- files.
-
- 14 Feb, 2020 7 commits
-
-
Steven Allen authored
-
Steven Allen authored
-
Steven Allen authored
It's a no-op if we don't need it.
-
Steven Allen authored
-
Steven Allen authored
Only allow keys of the form `/[0-9A-Z+-_=]`. That is, upper-case alphanumeric keys in the root namespace (plus some special characters). Why? We don't encode keys before writing them to the filesystem. This change ensures that: 1. Case sensitivity doesn't matter because we only allow upper-case keys. 2. Path separators and special characters doesn't matter. For context, go-ipfs only uses flatfs for storing blocks. Every block CID is encoded as uppercase alphanumeric text (specifically, uppercase base32). We could be less restrictive, but this is safer and easier to understand. Unfortunately, we _can't_ allow mixed case (Windows) and can't allow lowercase because we're already using uppercase keys. fixes #23
-
Steven Allen authored
That way, we're finally implementing everything.
-
Steven Allen authored
While this datastore is still quite limited, we might as well support everything we easily can.
-
- 11 Feb, 2020 1 commit
-
-
Steven Allen authored
And better handle prefixes.
-
- 03 Dec, 2019 1 commit
-
-
Adin Schmahmann authored
-
- 02 Dec, 2019 1 commit
-
-
Michael Muré authored
-
- 21 Aug, 2019 2 commits
-
-
Steven Allen authored
-
Steven Allen authored
-
- 15 Mar, 2019 1 commit
-
-
Steven Allen authored
Merge before: https://github.com/ipfs/go-datastore/pull/120
-
- 01 Mar, 2019 2 commits
-
-
Steven Allen authored
1. Use []byte instead of interface{}. 2. Handle rename errors. 3. Correctly temporary files.
-
Steven Allen authored
(and make Close threadsafe)
-
- 18 Dec, 2018 1 commit
-
-
Steven Allen authored
Closing a query early could leak the query goroutine if the buffer isn't large enough to fit the rest of the query.
-
- 04 Oct, 2018 1 commit
-
-
Steven Allen authored
-
- 10 Sep, 2018 1 commit
-
-
b5 authored
-
- 13 Aug, 2018 1 commit
-
-
Steven Allen authored
-
- 03 Apr, 2018 2 commits
-
-
Kevin Atkinson authored
-
Kevin Atkinson authored
-
- 01 Apr, 2018 1 commit
-
-
Kevin Atkinson authored
-
- 29 Mar, 2018 1 commit
-
-
Kevin Atkinson authored
-
- 27 Mar, 2018 1 commit
-
-
Kevin Atkinson authored
Also sync contents of diskUsage.cache to disk after the initial calculation and during shutdown.
-
- 26 Mar, 2018 1 commit
-
-
Kevin Atkinson authored
-
- 25 Mar, 2018 3 commits
-
-
Kevin Atkinson authored
-
Kevin Atkinson authored
-
Kevin Atkinson authored
-
- 24 Mar, 2018 1 commit
-
-
Kevin Atkinson authored
This simplifies the code with perhaps a slightly higher overhead during write operations.
-