Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vanja-vechain
Copy link
Contributor

Description

Sync without indexes and with journal off

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also
list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Go Version:
  • Hardware:
  • Docker Version:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • New and existing E2E tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have not added any vulnerable dependencies to my code

@vanja-vechain vanja-vechain requested a review from a team as a code owner September 29, 2025 11:15
@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 0% with 81 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
logdb/logdb.go 0.00% 47 Missing ⚠️
cmd/thor/node/packer_loop.go 0.00% 24 Missing ⚠️
cmd/thor/node/node.go 0.00% 6 Missing ⚠️
cmd/thor/node/block_exec.go 0.00% 2 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

paologalligit
paologalligit previously approved these changes Sep 29, 2025
Copy link
Member

@paologalligit paologalligit left a comment

Choose a reason for hiding this comment

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

Looks good, left just a couple of minor comments. Also, if you have the manual test results on how the db time and space is impacted, would you mind attaching those in the pr? It could be useful in the future if this bit will come up again.

logger.Error("Error while creating indexes", "err", err)
return err
}
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a duplicate from above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, fixed now

conflicts []thor.Bytes32
)

if n.completingSync {
Copy link
Member

Choose a reason for hiding this comment

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

small thing: what if we had something like

func (n *Node) guardBlockProcessing(blockNum uint32, process func(conflicts uint32) (thor.Bytes32, error)) error {
    if n.completingSync {
        <-n.syncCompleteCh
    }

	n.processLock.Lock()
	defer n.processLock.Unlock()

	var (
		err       error
		blockID   thor.Bytes32
		conflicts []thor.Bytes32
	)

so that we don't lock - unlock - and relock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, applied

Copy link
Member

@freemanzMrojo freemanzMrojo left a comment

Choose a reason for hiding this comment

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

LGTM, left some comments

@libotony
Copy link
Member

@vanja-vechain
Copy link
Contributor Author

@vanja-vechain Please also consider take this into account https://github.com/vechain/thor/blob/release/v2.4.1/cmd/thor/node/block_exec.go#L285-L292

Yes, this is taken into account, without wal is actually executing for w = n.logDB.NewWriterSyncOff()

freemanzMrojo
freemanzMrojo previously approved these changes Oct 1, 2025
@vanja-vechain vanja-vechain changed the base branch from release/v2.4.1-backup-2 to release/v2.4.1 November 6, 2025 13:07
@vanja-vechain vanja-vechain dismissed stale reviews from freemanzMrojo and paologalligit November 6, 2025 13:07

The base branch was changed.

@vanja-vechain vanja-vechain changed the base branch from release/v2.4.1 to release/v2.4.1-backup-2 November 6, 2025 15:39
@vanja-vechain
Copy link
Contributor Author

Replace with #1478

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.

6 participants