Commit Graph

40 Commits

Author SHA1 Message Date
Miroslav Crnic
768072e054 kmod: remove block service cache
With reduced span cache time the block service cache
is no longer needed. We also don't need to fetch
changed block services from registry as we'll get
it as part of span fetches.
2025-12-09 15:34:09 +00:00
Isabella Bosia
c0039428e3 unify send recv loops (#76)
* kmod: unify recv loops

* kmod: unify send loops

* kmod: make control flow explicit
2025-11-27 11:16:33 +00:00
Joshua Leahy
7a4e466ac6 Make TernFS open source 2025-09-17 18:20:23 +01:00
Miroslav Crnic
92d25d04da shuckle: rename to registry prepare for replace 2025-09-08 08:59:08 +00:00
Francesco Mazzoli
110705db8d EggsFS -> TernFS rename
Things not done because probably disruptive:

* kmod filesystem string
* sysctl/debugfs/trace
* metrics names
* xmon instance names

Some of these might be renamed too, but starting with a relatively
safe set.
2025-09-03 09:29:53 +01:00
Francesco Mazzoli
a512f07da1 Use DNS to reach shuckle, kill shuckle beacon 2025-05-29 13:40:21 +00:00
Miroslav Crnic
2b871133b7 kmod: remove warnings 2025-04-04 17:24:05 +01:00
Miroslav Crnic
5f24b43184 shuckle: support locations 2024-11-14 09:26:44 +00:00
Miroslav Crnic
a691e78392 kmod: do fstat on 1 min timer and cache it 2024-10-09 15:23:11 +01:00
Miroslav Crnic
0f78430efc kmod: fix block_services_last_changed_time on mount 2024-09-24 08:40:33 +00:00
Miroslav Crnic
802ecea6f4 kmod: prevent undeflow when initalizing block_services_last_changed_time 2024-08-29 16:58:19 +01:00
Saulius Grusnys
8c4bd4d9e6 [kmod] add ability to read single page from blockservice (#300)
* [kmod] add ability to read single page from blockservice

* Update kmod/span.c

Co-authored-by: Miroslav Crnic <miroslav.crnic@xtxmarkets.com>

---------

Co-authored-by: Miroslav Crnic <miroslav.crnic@xtxmarkets.com>
2024-08-21 15:50:28 +01:00
Miroslav Crnic
4d1d24cc45 kmod: force update attributes before updating atime 2024-07-25 10:43:36 +01:00
Miroslav Crnic
3fa23790bd kmod: periodically fetch block services with changed flags 2024-07-24 13:11:53 +01:00
Miroslav Crnic
8a0ea10cde core: UDPSocketPair and use IpPort AddrsInfo everywhere
* core: UDPSocketPair and use IpPort AddrsInfo everywhere

* Refactor UDPSocketPair a bit

* ci: kmod always delete img before create

* shuckle: fix scripts/json marshal

---------

Co-authored-by: Francesco Mazzoli <francesco.mazzoli@xtxmarkets.com>
2024-05-03 11:32:07 +01:00
Francesco Mazzoli
488f096eb9 Stat files/directories speculatively on readdir
Also, split the timeouts for dentries and for stats. We generally
don't care if stats are out of dates, but dentries should be up
to date.

The code leaves various aspects to be desired:

* No attempt is made to only send stats when needed -- it is always
    done. It might be a good idea to instead wait for the first two
    stats to come back.

* Theres quite a bit of code duplication.

* It's pretty wasteful to have so many different packets for the
    stats. It'd be much better to pack multiple requests and multiple
    responses in single packets.

    This could be done simply by allowing many requests to come
    in the same packet (just one after the other would be fine),
    and same for the responses. We can still use the protocol and
    request id to keep track of things anyway.
2024-03-19 20:29:23 +00:00
Francesco Mazzoli
32be159bae Better errors in kmod
As noted by @achen, from `recv(2)`:

    When  a  stream  socket peer has performed an orderly shutdown, the
    return value will be 0 (the traditional "end‐of‐file" return).
2024-02-27 11:07:23 +00:00
Francesco Mazzoli
0dba36ab4e ETIMEDOUT on zero response
The expected behavior is not really documented, but this seems to
be what is happening.
2024-02-23 15:31:43 +00:00
Francesco Mazzoli
7f647f7106 Bound DirInfoCache
@sgrusny observed that in the GC processes we often get timeouts
as go GC pauses increase because of the ever increasing size of
the dir info cache
2024-02-22 08:33:35 +00:00
Andrew Chen
0834c83e5c kmod: add mount options to set permissions: uid, gid, dmask, fmask 2023-12-22 10:23:09 +00:00
Francesco Mazzoli
9199fc6cc3 Fix bad sharing of struct eggsfs_fs_info between mounts 2023-12-19 16:55:13 +00:00
Francesco Mazzoli
af46ab2173 Bump CDC shard response timeout 2023-11-29 15:00:08 +00:00
Francesco Mazzoli
e8ef788725 Run shuckle refresh job on system_long_wq
Executing the work can take many seconds, so it seems appropriate
2023-11-29 14:58:20 +00:00
Saulius Grusnys
2ce5586eb9 Periodically refresh metadata info in kmod, use two IPs for shuckle
Fixes #112.

Co-authored-by: Francesco Mazzoli <francesco.mazzoli@xtxmarkets.com>
2023-11-14 13:49:36 +00:00
Francesco Mazzoli
c7875f479c Fill in inode info as soon as we create it
This change was triggered when a `open` + `lseek` sequence didn't
work, with `lseek` having `SEEK_END`, since `i_size` wasn't filled
in yet, and therefore the absolute file offset being negative.

Thanks to @sgrusny for pinpointing the issue.
2023-10-03 17:28:02 +01:00
Francesco Mazzoli
7cb226210b Fill in superblock blocksize
We realized that this was not set because `cp` was using `lseek`
to write out two bytes (see
<https://eulergamma.slack.com/archives/C03PCJMGAAC/p1696338647238759>).

We still need to address that problem, see #81.
2023-10-03 13:41:47 +00:00
Francesco Mazzoli
e71ea84e98 Various adjustments to NFS
The biggest one is correct error checking in `export.c`.
2023-10-02 15:57:45 +01:00
Saulius Grusnys
40afc8183e NFS support in kmod 2023-10-02 15:57:45 +01:00
Francesco Mazzoli
2dba467266 Set s_maxbytes in superblock
By default it is

    s->s_maxbytes = MAX_NON_LFS;

that is to say `((1UL<<31) - 1)`. This tripped us in `sendfile`,
when the upper bound is set to `s_maxbytes`:

    if (!max)
        max = min(in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes);

See <https://elixir.bootlin.com/linux/v5.4.249/source/fs/read_write.c#L1443>
2023-09-30 11:55:46 +00:00
Francesco Mazzoli
1cab680110 Support arbitrary span/block/... policies in kmod...
...and also update them quickly, by indexing them by (inode, tag).

Currently they only get updated on local renames though, we should
also update them when things are moved around remotely.
2023-08-22 15:01:33 +01:00
Francesco Mazzoli
37ce3be74c Implement utime-like functions
Also, update atime when opening a file.
2023-07-21 06:28:48 +00:00
Francesco Mazzoli
0fef0a34ed Cache and timeout fetch block sockets 2023-07-09 19:50:37 +00:00
Francesco Mazzoli
583b53a111 Continue tightening various ownership structures
Also, start renaming static stuff taking `eggsfs` out, I get tired
typing. Various other tweaks, too.
2023-06-13 14:52:45 +00:00
Francesco Mazzoli
c41620ab6d Fix InfoReq 2023-06-08 11:59:09 +00:00
Francesco Mazzoli
d076941ce8 Simplify block write/fetch
And hopefully reduce the likelihood of bugs. On the write end, given
that we do things less asynchronously, things might be a bit slower,
but I think the simplification is worth it for now.

Also, fix/improve a bunch of other stuff.
2023-06-08 11:59:09 +00:00
Francesco Mazzoli
b041d14860 Add second ip/addr for CDC/shards too
This is one of the two data model/protocol changes I want to perform
before going into production, the other being file atime.

Right now the kernel module does not take advantage of this, but
it's OK since I tested the rest of the code reasonably and the goal
here is to perform the protocol/data changes.
2023-06-05 12:14:14 +00:00
Francesco Mazzoli
55074b16b4 Implement fs stat
10.97.12.10:10001       29P  208T   29P   1% /home/restechprod/eggs/mnt
2023-05-29 18:49:50 +00:00
Francesco Mazzoli
f95d177c34 WIP commit...
...which I mistakely left in and I'm too lazy to fix.
2023-05-26 17:22:30 +00:00
Francesco Mazzoli
972bb55356 A few tweaks
Notably, make heavy debug output a sysctl flag.
2023-05-19 10:57:26 +00:00
Francesco Mazzoli
6addbdee6a First version of kernel module
Initial version really by Pawel, but many changes in between.

Big outstanding issues:

* span cache reclamation (unbounded memory otherwise...)
* bad block service detection and workarounds
* corrupted blocks detection and workaround

Co-authored-by: Paweł Dziepak <pawel.dziepak@xtxmarkets.com>
2023-05-18 15:29:41 +00:00