-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IOTracing PR1] Store FileSystemPtr object that contains FileSystem ptr #7180
Conversation
0b64fd7
to
62a11f0
Compare
475092a
to
facec29
Compare
Passed IOTracer as argument in existing constructor instead of writing a new one as list of arguments was long in the constructors and BlockCacheTrace was already passed as nullptr in many test cases so I passed IOTracer=nullptr as well in those testcases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
db/compaction/compaction_job.cc
Outdated
@@ -1564,7 +1565,8 @@ Status CompactionJob::OpenCompactionOutputFile( | |||
&syncpoint_arg); | |||
#endif | |||
Status s; | |||
IOStatus io_s = NewWritableFile(fs_, fname, &writable_file, file_options_); | |||
IOStatus io_s = NewWritableFile(db_options_.fs.get(), fname, &writable_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we pass the right pointer from fs_
instead of db_options_.fs
? Otherwise, this won't get traced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, this is not getting traced. But since its a one line function to trace FileSystem::NewWritableFile so I will pass the pointer.
env/file_system_tracer.h
Outdated
@@ -80,6 +79,9 @@ class FileSystemPtr { | |||
} | |||
} | |||
|
|||
/* Returns the underlying File System pointer */ | |||
FileSystem* get() const { return fs_.get(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be conditional on whether tracing is on or off. If its on, it should return fs_tracer_.get()
.
Summary: As part of the IOTracing project, this PR 1. Caches "FileSystemPtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FileSystem" pointer. 2. FileSystemPtr object is created using FileSystem pointer and IOTracer pointer. 3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor. 4. When tracing is enabled through DB::StartIOTrace, FileSystemPtr returns FileSystemTracingWrapper pointer for tracing purpose and when it is disabled underlying FileSystem pointer is returned. Test Plan: make check -j64 COMPILE_WITH_TSAN=1 make check -j64 Reviewers: Subscribers: Tasks: Tags: Tags:
facec29
to
c1f2d1f
Compare
@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing. |
Addressed Comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akankshamahajan15 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@akankshamahajan15 merged this pull request in 1f9f630. |
…ok#7180 Summary: As part of the IOTracing project, this PR 1. Caches "FSSequentialFilePtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FSSequentialFile" pointer. 2. FSSequentialFilePtr object is created using FSSequentialFile pointer and IOTracer in SequentialFileReader. 3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor. 4. When tracing is enabled through DB::StartIOTrace, FSSequentialFilePtr object returns FSSequentialFileTracingWrapper pointer for tracing purpose and when it is disabled underlying FSSequentialFile pointer is returned. Test Plan: make check -j64 COMPILE_WITH_TSAN=1 make check -j64 Reviewers: Subscribers: Tasks: Tags:
Summary: As part of the IOTracing project, this PR 1. Caches "FileSystemPtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FileSystem" pointer. 2. FileSystemPtr object is created using FileSystem pointer and IOTracer pointer. 3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor. 4. When tracing is enabled through DB::StartIOTrace, FileSystemPtr returns FileSystemTracingWrapper pointer for tracing purpose and when it is disabled underlying FileSystem pointer is returned. Pull Request resolved: facebook#7180 Test Plan: make check -j64 COMPILE_WITH_TSAN=1 make check -j64 Reviewed By: anand1976 Differential Revision: D22987117 Pulled By: akankshamahajan15 fbshipit-source-id: 6073617e4c2d5bc363914f3a1f55ae3b0a58fbf1
Summary: As part of the IOTracing project, this PR 1. Caches "FileSystemPtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FileSystem" pointer. 2. FileSystemPtr object is created using FileSystem pointer and IOTracer pointer. 3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor. 4. When tracing is enabled through DB::StartIOTrace, FileSystemPtr returns FileSystemTracingWrapper pointer for tracing purpose and when it is disabled underlying FileSystem pointer is returned. Pull Request resolved: facebook/rocksdb#7180 Test Plan: make check -j64 COMPILE_WITH_TSAN=1 make check -j64 Reviewed By: anand1976 Differential Revision: D22987117 Pulled By: akankshamahajan15 fbshipit-source-id: 6073617e4c2d5bc363914f3a1f55ae3b0a58fbf1 Signed-off-by: Changlong Chen <levisonchen@live.cn>
Summary: As part of the IOTracing project, this PR 1. Caches "FileSystemPtr" object(wrapper class that returns file system pointer based on tracing enabled) instead of "FileSystem" pointer. 2. FileSystemPtr object is created using FileSystem pointer and IOTracer pointer. 3. IOTracer shared_ptr is created in DBImpl and it is passed to different classes through constructor. 4. When tracing is enabled through DB::StartIOTrace, FileSystemPtr returns FileSystemTracingWrapper pointer for tracing purpose and when it is disabled underlying FileSystem pointer is returned. Pull Request resolved: facebook/rocksdb#7180 Test Plan: make check -j64 COMPILE_WITH_TSAN=1 make check -j64 Reviewed By: anand1976 Differential Revision: D22987117 Pulled By: akankshamahajan15 fbshipit-source-id: 6073617e4c2d5bc363914f3a1f55ae3b0a58fbf1 Signed-off-by: Changlong Chen <levisonchen@live.cn>
Test Plan: make check -j64
COMPILE_WITH_TSAN=1 make check -j64