-
There seems to be a behavior difference when executing
The issue is clear and the fix is known, however the same host (RedHat) without sudo, seems to work even with the db issue.
The question is why is the behaviour different between the command executing as root vs a regular user? I tried to search the code base but my knowledge is limited, and I'm guessing it has something to do with perhaps establishing a file or db lock or attempting to write to the db as root for some reason vs a pure read only as a user. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The regular user doesn't have write-permissions on the shared database environment (those __db.* files), which is required to register even a read-lock in there. So when running as a regular user, rpm cheats by using a private environment, which amounts to no locking at all wrt a concurrent writer. As in, it's unreliable and broken but the alternative of not allowing any queries for regular user is not really an option either. Note that this is specific to the deprecated Berkeley DB backend which has been entirely dropped upstream. The newer backends do not have such an issue. |
Beta Was this translation helpful? Give feedback.
The regular user doesn't have write-permissions on the shared database environment (those __db.* files), which is required to register even a read-lock in there. So when running as a regular user, rpm cheats by using a private environment, which amounts to no locking at all wrt a concurrent writer. As in, it's unreliable and broken but the alternative of not allowing any queries for regular user is not really an option either.
Note that this is specific to the deprecated Berkeley DB backend which has been entirely dropped upstream. The newer backends do not have such an issue.