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

[improve] Configure Rocksdb to use musl libc flavor of the native library #23375

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Sep 30, 2024

Motivation

When ROCKSDB_MUSL_LIBC=true is set in environment, it simplifies the logic on RocksDB side for initializing the library: https://github.com/facebook/rocksdb/blob/444b3f4845dd01b0d127c4b420fdd3b50ad56682/java/src/main/java/org/rocksdb/util/Environment.java#L73-L91

The problem with the RocksDB logic is that it executes a shell command to detect that it's running in a musl environment.
This could be a problem when shell commands are restricted due to security reasons.

    // check if ldd indicates a muslc lib
    try {
      final Process p =
          new ProcessBuilder("/usr/bin/env", "sh", "-c", "ldd /usr/bin/env | grep -q musl").start();
      if (p.waitFor() == 0) {
        return true;
      }
    } catch (final IOException | InterruptedException e) {
      // do nothing, and move on to the next check
    }

Modifications

  • pass ROCKSDB_MUSL_LIBC=true in the environment for the docker image

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@lhotari lhotari added this to the 4.0.0 milestone Sep 30, 2024
@lhotari lhotari self-assigned this Sep 30, 2024
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Sep 30, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.56%. Comparing base (bbc6224) to head (224202d).
Report is 614 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23375      +/-   ##
============================================
+ Coverage     73.57%   74.56%   +0.99%     
- Complexity    32624    34485    +1861     
============================================
  Files          1877     1934      +57     
  Lines        139502   145132    +5630     
  Branches      15299    15870     +571     
============================================
+ Hits         102638   108218    +5580     
+ Misses        28908    28621     -287     
- Partials       7956     8293     +337     
Flag Coverage Δ
inttests 27.49% <ø> (+2.91%) ⬆️
systests 24.50% <ø> (+0.17%) ⬆️
unittests 73.92% <ø> (+1.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 601 files with indirect coverage changes

@merlimat merlimat merged commit c41c7e9 into apache:master Oct 2, 2024
55 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants