Repository navigation
add missing file - #138
Merged
Merged
add missing file#138
Conversation
starocean999
pushed a commit
to starocean999/incubator-doris
that referenced
this pull request
Jul 26, 2023
zclllyybb
added a commit
that referenced
this pull request
Jul 12, 2026
…ability (#65178) The Codex GitHub Actions review pipeline needed stronger guarantees that agents review the intended PR snapshot, use one authoritative diff, pursue high-risk cross-module mechanisms, and expose the work of spawned subagents in Litefuse. This PR: - verifies the checked-out PR head and rechecks the live base/head after context preparation; - prepares an authoritative aggregate PR patch and changed-file list, with atomic bounded retry (`2s`, `4s`, `8s`) for transient GitHub API failures; - directs the main agent to perform an initial risk scan, dispatch focused subagents for suspicious mechanisms, maintain a shared append-only ledger, validate/deduplicate every candidate, and converge for at most three rounds; - requires paths outside the authoritative diff/changed-file context to be confirmed with `rg --files` before reading; - records separate Litefuse traces for each Codex subagent session, including command/tool I/O and non-empty encrypted-reasoning status, instead of mixing subagent activity into the main trace; - makes Litefuse ingestion more resilient to transport timeouts while keeping telemetry upload non-blocking for the review outcome. The repository review skill is kept focused on review invariants; orchestration and completion policy live in the workflow prompt, where they are available to the GitHub Actions invocation. ### Validation and experiment material - Static checks: `python3 -m py_compile .github/scripts/emit_litefuse_otel_io.py` and `git diff --check`. - Litefuse uploader validation: real/synthetic subagent session conversion, payload-limit coverage, and readback of independent subagent traces. - End-to-end replayed review experiments against fresh fork PRs built from the original PR base/head commits: | Replay PR | GitHub Actions run | Result | | --- | --- | --- | | [#136](zclllyybb#136) | [29112823062](https://github.com/zclllyybb/doris/actions/runs/29112823062) | Success; 2 inline comments | | [#137](zclllyybb#137) | [29114260631](https://github.com/zclllyybb/doris/actions/runs/29114260631) | Success; 3 inline comments | | [#138](zclllyybb#138) | [29115946034](https://github.com/zclllyybb/doris/actions/runs/29115946034) | Success; 1 inline comment | | [#139](zclllyybb#139) | [29150372758](https://github.com/zclllyybb/doris/actions/runs/29150372758) | Success; 1 inline comment | | [#140](zclllyybb#140) | [29151057520](https://github.com/zclllyybb/doris/actions/runs/29151057520) | Success; 1 inline comment | The latest replay trace, `86be226391a40e5992bb8d3b4e125eca`, confirms one authoritative `pr.diff` read, two changed-file-list reads, no `gh pr diff` or `git diff` calls from the reviewing agent, and separate subagent sessions. It also exposed one remaining prompt-compliance gap: a guessed adjacent `.cpp` path was read without a preceding `rg --files` lookup; this is documented test evidence rather than hidden by the validation.
Ryan19929
added a commit
to Ryan19929/doris
that referenced
this pull request
Nov 13, 2026
… restore DOWNLOAD journal ### What problem does this PR solve? Issue Number: None Related PR: apache#138 Problem Summary: The previous commits serialize a non-done restore job in the calling thread before it is queued to the EditLog flusher. For the DOWNLOAD journal this takes minutes, and the restore thread holds only the job lock meanwhile. A DROP TABLE FORCE (or DROP DATABASE FORCE) of a restored table, which the RESTORE table state does not stop, can take the db write lock and commit its DROP_TABLE journal first. Replaying DROP_TABLE -> DOWNLOAD ignores the drop because the table does not exist yet, then replayCheckAndPrepareMeta() registers the table again. If the FE restarts or the master changes before the CANCELLED journal is written, the dropped table comes back and the restore keeps running on it. The same race existed before with a much smaller window, because checkIfNeedCancel() does not hold the db lock either. Fix: RestoreJob.logDownloadJournal() (also used by CloudRestoreJob) serializes the job without the db lock, then takes the db read lock, runs checkIfNeedCancel() again and logs the pre-serialized journal under that lock. A force drop either commits before the recheck, so the DOWNLOAD journal is not written and run() cancels the job, or waits for the db write lock until DOWNLOAD is logged. Holding the db read lock while waiting for the journal is lighter than DROP/CREATE TABLE, which wait for their journals under the db write lock; heartbeat, report, publish, checkpoint and BDB threads do not take db locks. The caller-serialized bytes are now kept in SerializedJournalEntity, already in the JournalEntity format (op code + data), and JournalBatch.addJournal() uses its buffer directly. This removes the extra copy of a large job in the flusher, so peak memory stays at the level before serializing in the caller thread. ### Release note None ### Check List (For Author) - Test: Unit Test - run-fe-ut.sh on Linux: EditLogTest, RestoreJobTest, JournalBatchTest, BackupJobTest, BackupJobInfoTest, BackupRestoreJobStreamingJsonConfigTest, BDBJEJournalTest, 54 tests passed; fe-core checkstyle passed - New RestoreJobTest cases fail when the recheck under the db read lock is removed - Behavior changed: No - Does this need documentation: No
Ryan19929
added a commit
to Ryan19929/doris
that referenced
this pull request
Nov 13, 2026
… DOWNLOAD journal ### What problem does this PR solve? Issue Number: None Related PR: apache#138 Problem Summary: The master registers all restored tables, including views and other non-OLAP tables, when the restore job leaves PENDING, but the first journal that carries them is DOWNLOAD. A restored view can be dropped meanwhile with a plain DROP VIEW, since only OLAP tables are kept in the RESTORE state, and checkIfNeedCancel() only checks the OLAP tables in the file mapping, so the job goes on and logs DOWNLOAD after DROP_TABLE. A follower replaying DROP_TABLE ignores it because the view does not exist there yet, and then registers the view from the DOWNLOAD journal. The follower keeps a view the master no longer has, and it comes back after a master change. Fix: under the db read lock in logDownloadJournal(), also check that every table in restoredTbls is still registered as the same object. If one has been dropped, the DOWNLOAD journal is not logged and the job is cancelled, as for a dropped OLAP table. ### Release note Dropping a view that is being restored before the restore job reaches DOWNLOAD now cancels the restore job, instead of leaving the view on followers. ### Check List (For Author) - Test: Unit Test - run-fe-ut.sh on Linux: EditLogTest, RestoreJobTest, JournalBatchTest, BackupJobTest, BackupJobInfoTest, BackupRestoreJobStreamingJsonConfigTest, BDBJEJournalTest, 55 tests passed; fe-core checkstyle passed - The new RestoreJobTest case fails when the restoredTbls check is removed - Behavior changed: Yes. Dropping a restored view before DOWNLOAD cancels the restore job. - Does this need documentation: No
Ryan19929
added a commit
to Ryan19929/doris
that referenced
this pull request
Nov 17, 2026
…le write lock counts ### What problem does this PR solve? Issue Number: None Related PR: apache#138 Problem Summary: The master registers restoredTbls, and adds restoredPartitions to existing tables, in allReplicasCreated() without a journal. Followers learn about these objects only when they replay the DOWNLOAD journal (replayCheckAndPrepareMeta). Any journal about them that comes earlier is skipped on replay, because the objects do not exist yet. So the DOWNLOAD journal must carry the objects as they are at its place in the log: a dropped object must not be in it, and a change logged earlier must be in it. The previous commits serialize the DOWNLOAD journal in the caller thread before it is queued, so the snapshot can be minutes older than its place in the log. Rechecking drops under the db read lock is not enough. For example, ALTER VIEW mutates the same View instance and logs OP_MODIFY_VIEW_DEF in the window. The identity check still passes, the stale bytes are written, and replay loses the change. About 20 other paths that the RESTORE table state does not block have the same problem: REPLACE TABLE, RECOVER, ADMIN SET REPLICA/PARTITION VERSION, tablet report replica changes, clone, consistency check, constraints, and loads on tables restored with allow_load. Fix: 1. Table counts how many times its write lock has been taken. Every logged change of the objects in the DOWNLOAD journal takes the write lock of one of the tables it carries. 2. RestoreJob.logDownloadJournal() reads the counts, serializes the job without any lock, then takes the db read lock and the table read locks. It rechecks drops, which cancel the job, and queues the journal only if the counts are unchanged. The locks are released as soon as the journal is queued, not after it is written, through the new afterQueued callback of EditLog.logRestoreJob(). 3. If a table has been written in the meantime, the job is serialized again. After 2 attempts, the job is queued unserialized under the same locks and the flusher serializes it, as before this PR. Jobs whose objects can be changed without a table write lock always take this path: restored resources, tables with a storage policy, and restored tables with an auto increment column. Also fix cancel cleanup. cleanMetaObjects() unregistered restored tables by name, and dropped restored partitions by name, so it could remove a table, view or partition that a user had created with the same name after the restored one was dropped. Replay of CANCELLED does not do this, so master and followers diverged. Tables are now unregistered by id, and a restored partition is dropped only if the table still holds that partition id. This issue exists before this PR too, through DROP TABLE FORCE plus CREATE TABLE with the same name, or a same-name table created during CREATING. ### Release note Cancelling a restore job no longer removes a table, view or partition that was created with the name of a dropped restored object. ### Check List (For Author) - Test: Unit Test - RestoreJobTest, EditLogTest, TableTest, JournalBatchTest, BackupJobTest, BackupJobInfoTest, BackupRestoreJobStreamingJsonConfigTest, BDBJEJournalTest: 77 tests passed with run-fe-ut.sh on Linux, JDK 17. fe-core checkstyle has 0 violations. - Mutation checks: ignoring the write lock counts fails the 4 tests of journals written while serialized; unregistering by name fails the 2 same-name table and view tests; dropping the partition without the id check fails the same-name partition test; running afterQueued after the write fails the queue order test. - Not covered: real BDB replication, restart, multi-FE failover, CloudRestoreJob, and Alter.modifyViewDef itself (the test mirrors its lock protocol). - Behavior changed: Yes. A restore job cancel only removes the objects that the job itself created. A DOWNLOAD journal whose tables keep being written falls back to serialization in the EditLog flusher. - Does this need documentation: No
Ryan19929
added a commit
to Ryan19929/doris
that referenced
this pull request
Nov 17, 2026
… and identity ### What problem does this PR solve? Issue Number: None Related PR: apache#138 Problem Summary: RestoreJob.isEveryLoggedChangeUnderTableWriteLock() called restoredTbls.contains() for every OLAP table the DOWNLOAD journal carries. restoredTbls is a list, and OlapTable.equals() compares the content, so restoring N new tables cost N(N+1)/2 content comparisons per check: 80,200 for 400 tables. The check now looks up the auto increment generator first, and then the table id in a set of restored table ids, which is O(T + R). logDownloadJournalIfUnchanged() compared the tables found under the locks with the tables found before the serialization by List.equals(), which also uses OlapTable.equals(). It is meant to prove that they are the same objects, so it now compares references. ### Release note None ### Check List (For Author) - Test: Unit Test - RestoreJobTest, EditLogTest, TableTest, JournalBatchTest, BackupJobTest, BackupJobInfoTest, BackupRestoreJobStreamingJsonConfigTest, BDBJEJournalTest: 77 tests passed with run-fe-ut.sh on Linux, JDK 17. fe-core checkstyle has 0 violations. - No new test: the behavior is unchanged and covered by the existing tests. A different table object that equals the serialized one is not reachable, because checkIfNeedCancel() cancels the job first. - Behavior changed: No - Does this need documentation: No
Ryan19929
added a commit
to Ryan19929/doris
that referenced
this pull request
Nov 19, 2026
…tion, and remove every restored table type on cancel ### What problem does this PR solve? Issue Number: None Related PR: apache#138 Problem Summary: Three problems in the restore DOWNLOAD journal path: 1. Lock order. logDownloadJournalIfUnchanged() read locked the tables of the journal in id order, then called checkIfNeedCancel(), which read locks the tables in fileMapping one by one. Take a table A that is only in fileMapping, because data is restored into a partition it already has, and a table B in the journal, with A.id < B.id. A load that commits into both write locks A and then B, in id order and without a timeout (BrokerLoadJob). The restore job held B and waited for A while the load held A and waited for B, and the job kept the db read lock, so DDL on the db blocked too. Now the tables in fileMapping are locked together with the tables of the journal, in id order, and checkIfNeedCancel() only reenters those read locks. 2. Serialization failure. The job is pre-serialized without table locks. ReportHandler can delete a replica under the table write lock while Gson iterates Tablet.replicas, which throws ConcurrentModificationException. SerializedJournalEntity.serialize() then called System.exit(-1) before the write lock count check and the retry could run. Now serialize() returns null on an Exception. The DOWNLOAD journal serializes the job again, which the write lock count requires anyway, and EditLog.logJob() leaves the job to the flusher, as before the PR. An Error is still fatal. A CME in the flusher still exits the FE, as in the baseline. 3. Cancel cleanup. cleanMetaObjects() unregistered only OLAP tables and views from restoredTbls, while the master registers restored ODBC tables too, without a journal, before DOWNLOAD. A cancel before DOWNLOAD left them on the master, while followers never had them. Every restored table type is now unregistered by id, and the tablets of an OLAP table are still removed from the inverted index. The same leak exists in the baseline for any cancel before DOWNLOAD. ### Release note Cancelling a restore job now also removes the ODBC tables it has created. ### Check List (For Author) - Test: Unit Test - RestoreJobTest, EditLogTest, TableTest, JournalBatchTest, BackupJobTest, BackupJobInfoTest, BackupRestoreJobStreamingJsonConfigTest, BDBJEJournalTest: 81 tests passed with run-fe-ut.sh on Linux, JDK 17. fe-core checkstyle has 0 violations. - New tests: a load that write locks the fileMapping-only table first, then the journal table; a replica deleted by another thread while Gson iterates the replica list (a real ConcurrentModificationException); a job whose caller-thread serialization fails and is serialized by the flusher; cancel and replay cancel of a restore with a new ODBC table, including a cancel because a restored view was dropped. - Mutation checks: locking only the journal tables fails the lock order test; rethrowing the serialization exception fails the 2 serialization failure tests; unregistering only OLAP tables and views fails the 3 ODBC tests; removing the flusher fallback of logJob fails the EditLog serialization failure test. - Not covered: real BDB replication, restart, multi-FE failover, CloudRestoreJob, non-batch edit log mode. - Behavior changed: Yes. Cancelling a restore job, and replaying its cancellation, removes restored ODBC tables too. - Does this need documentation: No
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ShowUserStmt.java