Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 6 additions & 34 deletions cassandra-schema.cql
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,6 @@ CREATE TABLE brig_test.service_prefix (
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

CREATE KEYSPACE galley_test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

CREATE TYPE galley_test.permissions (
Expand Down Expand Up @@ -1442,19 +1441,15 @@ CREATE TABLE galley_test.team_admin (
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

-- NOTE: this table is unused. It was replaced by mls_group_member_client
CREATE TABLE galley_test.member_client (
conv uuid,
user_domain text,
CREATE TABLE galley_test.user (
user uuid,
client text,
key_package_ref blob,
PRIMARY KEY (conv, user_domain, user, client)
) WITH CLUSTERING ORDER BY (user_domain ASC, user ASC, client ASC)
AND bloom_filter_fp_chance = 0.01
conv uuid,
PRIMARY KEY (user, conv)
) WITH CLUSTERING ORDER BY (conv ASC)
AND bloom_filter_fp_chance = 0.1
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
Expand Down Expand Up @@ -1697,27 +1692,6 @@ CREATE TABLE galley_test.mls_proposal_refs (
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

CREATE TABLE galley_test.user (
user uuid,
conv uuid,
PRIMARY KEY (user, conv)
) WITH CLUSTERING ORDER BY (conv ASC)
AND bloom_filter_fp_chance = 0.1
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

CREATE KEYSPACE gundeck_test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

CREATE TABLE gundeck_test.push (
Expand Down Expand Up @@ -1832,7 +1806,6 @@ CREATE TABLE gundeck_test.user_push (
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

CREATE KEYSPACE spar_test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;

CREATE TABLE spar_test.bind_cookie (
Expand Down Expand Up @@ -2204,4 +2177,3 @@ CREATE TABLE spar_test.user (
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

1 change: 1 addition & 0 deletions changelog.d/3-bug-fixes/PR-3680
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
galley's DB migrations fixed
2 changes: 1 addition & 1 deletion hack/bin/cassandra_dump_schema
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main():
for keyspace in keyspaces:
if keyspace.endswith('_test'):
s = run_cqlsh(container, f'DESCRIBE keyspace {keyspace}')
print()
print(s)

if __name__ == '__main__':
main()
3 changes: 1 addition & 2 deletions services/galley/galley.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ library
Galley.Schema.V85_MLSDraft17
Galley.Schema.V86_TeamFeatureMlsMigration
Galley.Schema.V87_TeamFeatureSupportedProtocols
Galley.Schema.V88_TruncateMLSGroupMemberClient
Galley.Schema.V89_RemoveMemberClient
Galley.Schema.V88_RemoveMemberClientAndTruncateMLSGroupMemberClient
Galley.Types.Clients
Galley.Types.ToUserRole
Galley.Types.UserList
Expand Down
6 changes: 2 additions & 4 deletions services/galley/src/Galley/Schema/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ import Galley.Schema.V84_MLSSubconversation qualified as V84_MLSSubconversation
import Galley.Schema.V85_MLSDraft17 qualified as V85_MLSDraft17
import Galley.Schema.V86_TeamFeatureMlsMigration qualified as V86_TeamFeatureMlsMigration
import Galley.Schema.V87_TeamFeatureSupportedProtocols qualified as V87_TeamFeatureSupportedProtocols
import Galley.Schema.V88_TruncateMLSGroupMemberClient qualified as V88_TruncateMLSGroupMemberClient
import Galley.Schema.V89_RemoveMemberClient qualified as V89_RemoveMemberClient
import Galley.Schema.V88_RemoveMemberClientAndTruncateMLSGroupMemberClient qualified as V88_RemoveMemberClientAndTruncateMLSGroupMemberClient
import Imports
import Options.Applicative
import System.Logger.Extended qualified as Log
Expand Down Expand Up @@ -178,8 +177,7 @@ migrations =
V85_MLSDraft17.migration,
V86_TeamFeatureMlsMigration.migration,
V87_TeamFeatureSupportedProtocols.migration,
V88_TruncateMLSGroupMemberClient.migration,
V89_RemoveMemberClient.migration
V88_RemoveMemberClientAndTruncateMLSGroupMemberClient.migration
-- FUTUREWORK: once #1726 has made its way to master/production,
-- the 'message' field in connections table can be dropped.
-- See also https://github.com/wireapp/wire-server/pull/1747/files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
--
-- You should have received a copy of the GNU Affero General Public License along
-- with this program. If not, see <https://www.gnu.org/licenses/>.
module Galley.Schema.V88_TruncateMLSGroupMemberClient
module Galley.Schema.V88_RemoveMemberClientAndTruncateMLSGroupMemberClient
( migration,
)
where
Expand All @@ -28,6 +28,8 @@ import Text.RawString.QQ
-- could've been. This migration just deletes old data. This could break some
-- conversations/users in unknown ways. But those are most likely test users.
migration :: Migration
migration = Migration 88 "Truncate mls_group_member_client" $ do
migration = Migration 88 "Remove member_client and Truncate mls_group_member_client" $ do
schema'
[r|TRUNCATE TABLE mls_group_member_client|]
schema'
[r|DROP TABLE IF EXISTS member_client|]
33 changes: 0 additions & 33 deletions services/galley/src/Galley/Schema/V89_RemoveMemberClient.hs

This file was deleted.