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

feat: log malformed data during upsert ES docs #70

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Conversation

batrov
Copy link

@batrov batrov commented Jan 4, 2024

  • Log error related to malformed data type, due to ES cannot use ignore_malformed for object data type [ref]

@batrov batrov requested review from haveiss, sumslim and Mayurjag January 4, 2024 07:51
@coveralls
Copy link

coveralls commented Jan 4, 2024

Pull Request Test Coverage Report for Build 7407053139

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 85.132%

Totals Coverage Status
Change from base Build 7180351421: -0.04%
Covered Lines: 6333
Relevant Lines: 7439

💛 - Coveralls

@batrov batrov force-pushed the log-malformed-upsert branch from 7221f01 to 6bab8f3 Compare January 4, 2024 08:10
@batrov batrov force-pushed the log-malformed-upsert branch from 6bab8f3 to 5342b6e Compare January 4, 2024 08:14
@@ -61,6 +65,10 @@ func (m *InSituWorker) EnqueueSyncAssetJob(ctx context.Context, service string)

for _, ast := range assets {
if err := m.discoveryRepo.Upsert(ctx, ast); err != nil {
if strings.Contains(err.Error(), "illegal_argument_exception") {
m.logger.Error(err.Error())
continue
Copy link

Choose a reason for hiding this comment

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

@batrov just trying to understand here, if we have invalid format/argument for the field, we want to ignore it and keep processing remaining assets, but if we get any other error while upserting, we will return the error, without processing remaining assets?

Copy link
Author

Choose a reason for hiding this comment

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

yes that is expected, that way the backed up index won't get deleted and we can analyze other error before retrying the sync job.

@batrov batrov merged commit 4cbcaf2 into main Jan 4, 2024
4 checks passed
@batrov batrov deleted the log-malformed-upsert branch January 4, 2024 10:15
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.

4 participants