rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

Problems about FileSystem and Env/SpecialEnv

Open CoderSong2015 opened this issue 4 years ago • 2 comments

The Env interfaces and file system interfaces have been separated after v6.6? And I am encountering some problems when trying to add a new file system.

First, we have SpecialEnv which inherits EnvWrapper, but EnvWrapper doesn't provide constructor with env's file system and the default constructor will initial a file system called LegacyFileSystemWrapper, the LegacyFileSystemWrapper will just call env(and its function) to operate file. So I made this pr https://github.com/facebook/rocksdb/pull/9267

Second, in db_wal_test.cc EnrichedSpecialEnv implements its DeleteFile, the function will be called by LegacyFileSystemWrapper (because LegacyFileSystemWrapper just call env's function) so that it will fail when you want to call you own filesystem.

CoderSong2015 avatar Dec 09 '21 10:12 CoderSong2015

@mrambacher

CoderSong2015 avatar Dec 09 '21 10:12 CoderSong2015

It's a big mess. It's not clear at all what it means to override a function in Env but to provide different functionality for the equivalent function in FileSystem. IMHO all the FileSystem-related functions in Env should be made non-virtual so that callers can still use them but there is not confusion about which implementation is authoritative (FileSystem).

pdillinger avatar Jun 11 '25 23:06 pdillinger