The entry ranges
A test of the large objects of a store: an object of 8 GiB made by three range writes holds a few blocks; 1000 small writes at scrambled offsets and one commit hash and write what they touched, not the whole object; a version keeps its bytes; a cut and an extension; the refusals; the same object of 1 MiB under two names takes the blocks of one.
The first run (an empty store) checks each case, then makes a loop of range commits (the scenario of a loss of power stops the machine in it). The second run, on the same disk after a new start of the machine, reads back what the first run left, and writes the object of 1 MiB under a third name, which takes no block. Each case ends with a line "...: as it must", or a line "...: WRONG". The times and the counts of a commit are measures, printed: a case checks a bound that comes from the blocks changed, never a speed.
What it is for. It proves that the cost of a change of a large object follows the bytes changed, not the size of the object: a process can keep an object of gigabytes and change a few blocks of it in one commit.
Start: the machine test of the large objects starts it from the console with start("ranges"); it is not on the bar of the desktop. A reader can start it the same way; the second start, after a new start of the machine, runs the second run.
Grants, as the root service gives them:
- Store: its private store, with a limit of 12000 blocks: a commit of 1000 blocks spread over the object of 8 GiB holds about 2000 blocks with its version, and the loop of range commits about 4000.
What a reader sees: no window. The log has one log fact for each case, "...: as it must" or "...: WRONG" (where(verdict = "WRONG") keeps the cases that failed), the measures of the commits, and at the end "ranges: done, N wrong". The process stops with Done when no case is wrong, else with Failed.
The exports that it calls: write_range, set_size and commit of the storage service.
See: Storage: Large objects, Storage: The same object one time
ranges module with an entry
- Hash
17913b91f61b71393eff3754f4b35dc8b2dd05cb814eb36d1f7a0c9cc8dd407b- Size
102400 bytes- Exports
0- Imports
0- Imported by
0- License
- MIT
A test of the large objects of a store: an object of 8 GiB made by three range writes holds a few blocks; 1000 small writes at scrambled offsets and one commit hash and write what they touched, not the whole object; a version keeps its bytes; a cut and an extension; the refusals; the same object of 1 MiB under two names takes the blocks of one
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/tests/ranges |
| Boot image | yes: in the boot image, 102400 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by | none |
Neighbours
It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.
Exports
| Export | What it does |
|---|---|
entry() | The entry of ranges: the first run on an empty store, or the second run on the store that the first run left; then it stops |
entry
entry()
The entry of ranges: the first run on an empty store, or the second run on the store that the first run left; then it stops.
It opens its private store and reads its usage; with no store or no usage it writes "ranges: WRONG: ..." and stops with Failed. A store with no object gives the first run: each case, then the loop of range commits. A store with objects gives the second run: it reads back the small object, the object of the cut and the object of the loop, and writes the object of 1 MiB under a third name. It writes "ranges: done, N wrong" and stops with Done, or Failed when a case is wrong.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/tests/ranges/main.odin:514
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | The test of the large objects of a store, written by ranges: a commit of 1000 blocks spread over an object of 8 GiB holds about 2000 blocks, with its version; the loop of range commits about 4000. | |
| Other terms of its start grant set | store_blocks = 12000 | |
| Budget that it asks for |
| No MODULE_BUDGET in its source: it asks for the least budget. |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module; the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
