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

flaky test: env_test: GetUniqueId() doesn't return unique id #7470

Closed
jay-zhuang opened this issue Sep 30, 2020 · 5 comments
Closed

flaky test: env_test: GetUniqueId() doesn't return unique id #7470

jay-zhuang opened this issue Sep 30, 2020 · 5 comments

Comments

@jay-zhuang
Copy link
Contributor

https://app.circleci.com/pipelines/github/facebook/rocksdb/3708/workflows/14702f71-5afb-4b50-b0b0-0344cecfb0d1/jobs/35850/steps

env/env_test.cc:1180: Failure
Value of: ids.count(unique_id) == 0
  Actual: false
Expected: true
[  FAILED  ] DefaultEnvWithoutDirectIO/EnvPosixTestWithParam.RandomAccessUniqueIDDeletes/0, where GetParam() = (0xb28860, false) (14 ms)
@jay-zhuang
Copy link
Contributor Author

jay-zhuang commented Oct 1, 2020

Seems like on ext4 filesystem, the GetUniqueId may return the same id.

virtual size_t GetUniqueId(char* /*id*/, size_t /*max_size*/) const {

The id has 3 parts:
https://github.com/facebook/rocksdb/blob/e5f755f55598256ae6cf80e716738a7d15439ca5/env/io_posix.cc#L347-L349

  1. st_dev: device number is const
  2. st_ino: inode number is not changed for ext4, as in the test, it create file right after delete, it reuses the same inode number. (seems btrfs still bump the inode number, so it cannot be reproduced on devserver)
  3. uversion: it's get from ioctl(FS_IOC_GETVERSION), on ext4, seems it could be duplicated.

@jay-zhuang
Copy link
Contributor Author

Hi @anand1976 @pdillinger, do you think it could be a correctness issue, as GetUniqueId() may return the same id for different files? Seems the API is only used for cache prefix:

static void GenerateCachePrefix(TCache* cc, TFile* file, char* buffer,
size_t* size) {
// generate an id from the file
*size = file->GetUniqueId(buffer, kMaxCacheKeyPrefixSize);

@jay-zhuang jay-zhuang changed the title flaky test: env_test flaky test: env_test: GetUniqueId() doesn't return unique id Oct 1, 2020
@jay-zhuang jay-zhuang changed the title flaky test: env_test: GetUniqueId() doesn't return unique id flaky test: env_test: GetUniqueId() doesn't return unique id Oct 1, 2020
@jay-zhuang
Copy link
Contributor Author

The problem can be reproduced by:
jay-zhuang@4540eb3

@jay-zhuang
Copy link
Contributor Author

Seems it's also causing #7405

jay-zhuang added a commit to jay-zhuang/rocksdb that referenced this issue Oct 6, 2020
It's a known issue, which is tracked in facebook#7405, facebook#7470. Disable it for
now.
@jay-zhuang jay-zhuang linked a pull request Oct 6, 2020 that will close this issue
facebook-github-bot pushed a commit that referenced this issue Oct 8, 2020
Summary:
It's a known issue, which is tracked in #7405, #7470. Disable it for
now.

Pull Request resolved: #7511

Reviewed By: zhichao-cao

Differential Revision: D24145075

Pulled By: jay-zhuang

fbshipit-source-id: 1858497972f2baba617867aaeac30d93b8305c80
@jay-zhuang
Copy link
Contributor Author

As it's a known issue that is tracking in #7405. We're disabling this flaky test for now: #7511

codingrhythm pushed a commit to SafetyCulture/rocksdb that referenced this issue Mar 5, 2021
Summary:
It's a known issue, which is tracked in facebook#7405, facebook#7470. Disable it for
now.

Pull Request resolved: facebook#7511

Reviewed By: zhichao-cao

Differential Revision: D24145075

Pulled By: jay-zhuang

fbshipit-source-id: 1858497972f2baba617867aaeac30d93b8305c80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant