Skip to content

blob_db: fix build failure when FLB_SQLDB is flipped off#12158

Open
RaJiska wants to merge 1 commit into
fluent:masterfrom
RaJiska:worktree-test-minimal-nopgsql
Open

blob_db: fix build failure when FLB_SQLDB is flipped off#12158
RaJiska wants to merge 1 commit into
fluent:masterfrom
RaJiska:worktree-test-minimal-nopgsql

Conversation

@RaJiska

@RaJiska RaJiska commented Jul 25, 2026

Copy link
Copy Markdown

Building with flag -DFLB_SQLDB=Off would result undeclared types as some gated includes were required for a successful build.

Reproducing:
Add -DDFLB_SQLDB=Off option to the Dockerfile resulting in build error (logs: before_fix.txt).

Changes fix the headers as well as including definitions that were previously missing when SQLDB is turned off, successfully building fluentbit (logs: after_fix.txt)


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility when database-backed features are unavailable.
    • Prevented build and integration issues in configurations without SQL database support.
    • Ensured blob storage operations return consistent results across supported configurations.
  • Refactor
    • Aligned optional database-related components with their enabled or disabled configuration.

Building with flag -DFLB_SQLDB=Off would result undeclared types as some gated includes were required for a successful build.

Signed-off-by: Ra'Jiska <dodo.lasticot@gmail.com>
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add blob database header dependencies, conditionally include SQLDB support in the systemd configuration, reorder related includes, and complete SQL-disabled blob database stubs with corrected signatures and unavailable-backend return values.

Changes

Blob database compatibility

Layer / File(s) Summary
Header and conditional include support
include/fluent-bit/flb_blob_db.h, plugins/in_systemd/systemd_config.h, src/flb_blob_db.c
Blob database declarations include required types and forward declarations, systemd includes SQLDB support conditionally, and blob database headers precede SQLDB headers.
SQL-disabled blob database stubs
src/flb_blob_db.c
The no-backend flb_blob_db_file_part_get_next signature includes part_count, and four missing operations return FLB_BLOB_DB_ERROR_NO_BACKEND_AVAILABLE.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: edsiper

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing build failures when FLB_SQLDB is disabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RaJiska
RaJiska force-pushed the worktree-test-minimal-nopgsql branch from 90aab82 to 33fdaaa Compare July 25, 2026 09:27
@RaJiska RaJiska changed the title blob_db: Fixes build failure when FLB_SQLDB is flipped off blob_db: fix build failure when FLB_SQLDB is flipped off Jul 25, 2026
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.

1 participant