Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indexing pending problem when running in import-DB mode #2401

Merged
merged 6 commits into from
Oct 26, 2020

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Oct 23, 2020

  • made the elastic search not index transactions if the node is node in the sender shard when running in import-db

@@ -35,7 +38,7 @@ func (wf *viewsFactory) Create() ([]Viewer, error) {
}

func (wf *viewsFactory) createTermuiConsole() (*termuic.TermuiConsole, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

vf instead wf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the update branch PR

)

if arguments.IsInImportDBMode {
log.Warn("the node is in import mode! Elastic search will not send cross shard transactions and rewards " +
Copy link
Contributor

Choose a reason for hiding this comment

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

rephrase to cross shard transactions and rewards where destination shard is not the current node's shard won't be indexed in Elastic Search as the es is the receiver here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rephrased

core/indexer/processTransactions.go Show resolved Hide resolved
bogdan-rosianu
bogdan-rosianu previously approved these changes Oct 26, 2020
bogdan-rosianu
bogdan-rosianu previously approved these changes Oct 26, 2020
@@ -275,10 +275,10 @@ func (tdp *txDatabaseProcessor) groupNormalTxsAndRewards(
case block.RewardsBlock:
rTxs := getRewardsTransaction(txPool, mb.TxHashes)
for hash, rtx := range rTxs {
dbTx := tdp.commonProcessor.buildRewardTransaction(rtx, []byte(hash), mbHash, mb, header, mbTxStatus)
addToAlteredAddresses(dbTx, alteredAddresses, mb, selfShardID, true)
alteredAddresses[dbTx.Receiver] = struct{}{}
Copy link
Contributor

Choose a reason for hiding this comment

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

This set is ok? It is done in the method addToAlteredAddresses called above only under some certain conditions. For case block.TxBlock: above this set is not done, this is why I thought that could be something wrong here or something missed 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.

removed, thanks

@iulianpascalau iulianpascalau merged commit 5f1c97c into feat/elastic-search-new-impl Oct 26, 2020
@iulianpascalau iulianpascalau deleted the es-index-fix-import-db branch October 26, 2020 11:13
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.

None yet

3 participants