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

Drop reference_sha column #3083

Merged
merged 26 commits into from
May 24, 2023
Merged

Drop reference_sha column #3083

merged 26 commits into from
May 24, 2023

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented May 16, 2023

@S7evinK S7evinK requested a review from a team as a code owner May 16, 2023 14:24
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Patch coverage: 39.53% and project coverage change: -0.05 ⚠️

Comparison is base (5d6221d) 66.44% compared to head (cfeb5a1) 66.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3083      +/-   ##
==========================================
- Coverage   66.44%   66.39%   -0.05%     
==========================================
  Files         497      499       +2     
  Lines       53746    53792      +46     
==========================================
+ Hits        35710    35717       +7     
- Misses      14486    14545      +59     
+ Partials     3550     3530      -20     
Flag Coverage Δ
unittests 49.59% <39.53%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
roomserver/api/query.go 0.00% <ø> (ø)
roomserver/internal/input/input_missing.go 67.60% <0.00%> (-0.45%) ⬇️
...oomserver/internal/perform/perform_inbound_peek.go 0.00% <0.00%> (ø)
...qlite3/deltas/20230516154000_drop_reference_sha.go 0.00% <0.00%> (ø)
roomserver/storage/sqlite3/storage.go 40.76% <ø> (ø)
roomserver/storage/tables/interface.go 81.48% <ø> (ø)
roomserver/types/types.go 70.27% <ø> (ø)
roomserver/internal/perform/perform_admin.go 39.40% <33.33%> (-0.51%) ⬇️
roomserver/storage/sqlite3/events_table.go 76.48% <34.78%> (-0.76%) ⬇️
...oomserver/storage/sqlite3/previous_events_table.go 65.57% <37.50%> (-19.80%) ⬇️
... and 11 more

... and 32 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

return fmt.Errorf("failed to query duplicate event ids")
}
if count > 0 {
return fmt.Errorf("unable to drop column, as there are duplicate event ids")
Copy link
Member

Choose a reason for hiding this comment

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

This is unfortunate as it would prevent people from upgrading Dendrite. Can we instead mix together the event nids for the affected rows? E.g given:

event_id | sha256 | nids
$foo | abc123 | [2,4]
$foo | def456 | [2,3]

replace it with:

$foo | [2,3,4]

?

roomserver/storage/postgres/previous_events_table.go Outdated Show resolved Hide resolved
Up: deltas.UpDropEventReferenceSHAPrevEvents,
},
}...)
logrus.Infof("cName: %s", cName)
Copy link
Member

Choose a reason for hiding this comment

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

Debug logging?

@S7evinK S7evinK merged commit 11b5570 into main May 24, 2023
@S7evinK S7evinK deleted the s7evink/eventreference branch May 24, 2023 10:14
S7evinK added a commit that referenced this pull request May 30, 2023
... as they could fail if there are duplicate events in
`roomserver_previous_events`.
This fixes the migration by trying to combine the `event_nids` if
possible (same room) as mentioned by @kegsay in
#3083 (comment)
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.

2 participants