facebook / facebook/rocksdb

Windows: Threads created by RocksDB are not impersonated

Open
#2,036 7 comments 0 reactions 0 assignees View on GitHub
windows
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

presumptions:
- the thread which opens a rocksdb is impersonating a user - the process user is a different user
- the process user does not have sufficient access rights for the database directory

rocksdb opens the database with success. Some functions (compacting?) are failing because they try to open files or try to move (rename) files because they run in a background thread. On windows newly created threads are running as the process user (and not as a impersonated user)

This is somewhat inconsistent, because there is no error when opening the database and also when inserting values (sometimes inserts fail - because files needs to be created/moved)

Solution could be that the database instance stores the impersonation (DuplicateTokenEx). Every tasks that starts for that specific database also gets that token and impersonates at the very beginning of execution of the task and reverts after the work is done.

PS: Thank you all for this wonderful piece of software.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.