Skip to content

[fix](export) make sure the export task being executed after writing "create export job" edit log#43250

Merged
morningman merged 1 commit intoapache:masterfrom
morningman:check_export_job
Nov 6, 2024
Merged

[fix](export) make sure the export task being executed after writing "create export job" edit log#43250
morningman merged 1 commit intoapache:masterfrom
morningman:check_export_job

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Nov 5, 2024

What problem does this PR solve?

Problem Summary:

Fix bug like:

java.lang.NullPointerException: Cannot invoke "org.apache.doris.load.ExportJob.replayExportJobState(org.apache.doris.load.ExportJobState)" because "job" is null
        at org.apache.doris.load.ExportMgr.replayUpdateJobState(ExportMgr.java:475) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.persist.EditLog.loadJournal(EditLog.java:390) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env.replayJournal(Env.java:2965) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.master.Checkpoint.doCheckpoint(Checkpoint.java:135) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.master.Checkpoint.runAfterCatalogReady(Checkpoint.java:80) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.common.util.MasterDaemon.runOneCycle(MasterDaemon.java:58) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.common.util.Daemon.run(Daemon.java:119) ~[doris-fe.jar:1.2-SNAPSHOT]

This is because the export job is finished before adding it.
The "finish" log is saved before "creating" log, so when replaying the "finish" log,
the export job can not be found.

This PR change the order of "writing create export job log" and adding export task event,
to avoid this error

Check List (For Committer)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No colde files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.
  • Release note

    None

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman
Copy link
Contributor Author

run buildall

@morningman
Copy link
Contributor Author

run buildall

@morningman morningman marked this pull request as ready for review November 5, 2024 14:10
@morningman morningman changed the title [fix](export) check export NPE [fix](export) make sure the export task being executed after writing "create export job" edit log Nov 5, 2024
morningman added a commit that referenced this pull request Nov 6, 2024
@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 6, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

PR approved by anyone and no changes requested.

@morningman morningman merged commit 84307c5 into apache:master Nov 6, 2024
morningman added a commit to morningman/doris that referenced this pull request Nov 6, 2024
…"create export job" edit log (apache#43250)

Problem Summary:

Fix bug like:
```
java.lang.NullPointerException: Cannot invoke "org.apache.doris.load.ExportJob.replayExportJobState(org.apache.doris.load.ExportJobState)" because "job" is null
        at org.apache.doris.load.ExportMgr.replayUpdateJobState(ExportMgr.java:475) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.persist.EditLog.loadJournal(EditLog.java:390) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.catalog.Env.replayJournal(Env.java:2965) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.master.Checkpoint.doCheckpoint(Checkpoint.java:135) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.master.Checkpoint.runAfterCatalogReady(Checkpoint.java:80) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.common.util.MasterDaemon.runOneCycle(MasterDaemon.java:58) ~[doris-fe.jar:1.2-SNAPSHOT]
        at org.apache.doris.common.util.Daemon.run(Daemon.java:119) ~[doris-fe.jar:1.2-SNAPSHOT]
```

This is because the export job is finished before adding it.
The "finish" log is saved before "creating" log, so when replaying the
"finish" log,
the export job can not be found.

This PR change the order of "writing create export job log" and `adding
export task` event, to avoid this error
morningman added a commit that referenced this pull request Nov 6, 2024
morningman added a commit that referenced this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.7-merged dev/3.0.3-merged p0_b reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments