vmexit / trio-sosp23-ae

Apache License 2.0
13 stars 4 forks source link

Using ArckFS with Java programs #4

Open hayley-leblanc opened 9 months ago

hayley-leblanc commented 9 months ago

Hi Trio authors,

Do you know if it possible to run Java programs that access files in an ArckFS instance (without significant modification to ArckFS/Java libraries)? I'm specifically trying to run some YCSB workloads on RocksDB on ArckFS but have so far been unsuccessful. I have tried the following.

  1. Using System.loadLibrary("sufs"); in the RocksDB client to load the libsufs library. This operation seems to succeed, but subsequent operations don't actually appear to invoke ArckFS functions. I suspect the problem is that the RocksDB client (which I did not write) does not directly call glibc system call wrappers, and the loaded library is not propagated through to the dependencies (but this could be totally off, I don't really know how loadLibrary works).
  2. Setting LD_PRELOAD=/lib/x86_64-linux-gnu/libsufs.so when invoking the java executable. This throws some odd errors, which I think are because ArckFS does not redirect accesses to files that are not descendants of /sufs to the kernel. This means that dependencies and such cannot be opened and java cannot run.

Are you aware of any other techniques I could try? I am by no means a Java expert so I suspect I've missed some things that I could try.

Thank you!

vmexit commented 9 months ago

Hi,

We did not try to run ArckFS with any Java program. The two problems you described are likely due to the way ArckFS intercepts glibc calls. ArckFS currently intercepts them by simply implementing a function with the same name, and in fact, this approach basically is at the mercy of the linker/loader to invoke the correct functions. We already observed some issues caused by this simple approach (See #3 of the known issues in the readme file).

Some better ways to intercept library/system calls are likely required to solve this issue. For example, SplitFS has a more complicated way to intercept library/system calls probably for this reason. There are also some other library/system call interception frameworks.

Hope it helps.

hayley-leblanc commented 9 months ago

Understood, thank you!