Skip to content
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

Closed

Conversation

akankshamahajan15
Copy link
Contributor

@akankshamahajan15 akankshamahajan15 commented Jul 28, 2020

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:

@akankshamahajan15 akankshamahajan15 force-pushed the IO_Tracing branch 3 times, most recently from 0b64fd7 to 62a11f0 Compare July 28, 2020 03:40
@akankshamahajan15 akankshamahajan15 marked this pull request as ready for review July 28, 2020 04:09
@akankshamahajan15 akankshamahajan15 changed the title Store FileSystemPtr object that contains FileSystem ptr [IOTracing PR1] Store FileSystemPtr object that contains FileSystem ptr Jul 28, 2020
@akankshamahajan15 akankshamahajan15 force-pushed the IO_Tracing branch 2 times, most recently from 475092a to facec29 Compare August 6, 2020 20:10
@akankshamahajan15
Copy link
Contributor Author

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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@@ -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,
Copy link
Contributor

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.

Copy link
Contributor Author

@akankshamahajan15 akankshamahajan15 Aug 10, 2020

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.

@@ -80,6 +79,9 @@ class FileSystemPtr {
}
}

/* Returns the underlying File System pointer */
FileSystem* get() const { return fs_.get(); }
Copy link
Contributor

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:
@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 has updated the pull request. You must reimport the pull request before landing.

@akankshamahajan15
Copy link
Contributor Author

Addressed Comments

Copy link
Contributor

@anand1976 anand1976 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@facebook-github-bot
Copy link
Contributor

@akankshamahajan15 merged this pull request in 1f9f630.

akankshamahajan15 added a commit to akankshamahajan15/rocksdb that referenced this pull request Aug 13, 2020
…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:
codingrhythm pushed a commit to SafetyCulture/rocksdb that referenced this pull request Mar 5, 2021
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
levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 18, 2021
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>
mm304321141 pushed a commit to bytedance/terarkdb that referenced this pull request Jun 23, 2021
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants