Skip to content

fix(fs): create parent directories before opening Jindo writers#430

Open
Zouxxyy wants to merge 3 commits into
alibaba:mainfrom
Zouxxyy:fix/jindo-create-parent-directory
Open

fix(fs): create parent directories before opening Jindo writers#430
Zouxxyy wants to merge 3 commits into
alibaba:mainfrom
Zouxxyy:fix/jindo-create-parent-directory

Conversation

@Zouxxyy

@Zouxxyy Zouxxyy commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: N/A

Ensure the Jindo file-system adapter creates a file's parent directory before opening its writer. Some Jindo-backed object stores require bucket or partition directories to exist before creating the first data file.

This prevents native writers from failing during flush or prepare-commit when writing the first file under a new directory.

Tests

  • cmake --build build --target paimon-fs-test -j 8
  • ./build/debug/paimon-fs-test (65 tests passed)
  • uvx pre-commit run --files src/paimon/CMakeLists.txt src/paimon/fs/jindo/jindo_file_system.cpp src/paimon/fs/jindo/jindo_file_system.h src/paimon/fs/jindo/jindo_file_system_unit_test.cpp

API and Format

No public API, storage format, or protocol changes.

Documentation

No documentation changes. This fixes existing Jindo file creation behavior.

Generative AI tooling

Generated-by: OpenAI Codex (GPT-5)

Copilot AI review requested due to automatic review settings July 16, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Jindo filesystem adapter so that Create() proactively creates the target file’s parent directory before opening a writer, improving compatibility with Jindo-backed object stores that require directory markers to exist.

Changes:

  • Create parent directories (via Mkdirs) in JindoFileSystem::Create() before opening a writer.
  • Refactor writer-opening into an overridable OpenWriter() helper to enable focused unit testing.
  • Add unit tests for the parent-directory behavior and wire them into the Jindo FS test target.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/paimon/fs/jindo/jindo_file_system.h Adds a protected OpenWriter() hook for Create() to call.
src/paimon/fs/jindo/jindo_file_system.cpp Creates parent directory before writer open; factors writer open into OpenWriter().
src/paimon/fs/jindo/jindo_file_system_unit_test.cpp Adds unit tests verifying parent-dir creation ordering and error propagation.
src/paimon/CMakeLists.txt Registers the new Jindo filesystem unit test source when Jindo is enabled.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +72 to +75
const std::string parent_path = PathUtil::GetParentDirPath(path);
if (!parent_path.empty()) {
PAIMON_RETURN_NOT_OK(Mkdirs(parent_path));
}

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@lxy-9602
lxy-9602 requested a review from zjw1111 July 18, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants