Commit 17bb757f authored by Mike Kozono's avatar Mike Kozono

Geo: Fix undefined separate_verification_state_table?

Changelog: fixed
EE: true
parent 15c73d5d
......@@ -53,12 +53,6 @@ module Geo
.primary_key_in(range)
.pluck_primary_key
end
# @return whether primary checksum data is stored in a table separate
# from the model table
def separate_verification_state_table?
verification_state_table_name != table_name
end
end
end
end
......@@ -200,6 +200,12 @@ module Geo
verification_state_table_class.arel_table
end
# @return whether primary checksum data is stored in a table separate
# from the model table
def separate_verification_state_table?
verification_state_table_name != table_name
end
def verification_timed_out_batch_query
return verification_timed_out unless separate_verification_state_table?
......
......@@ -8,6 +8,7 @@ RSpec.describe Geo::VerificationState do
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
context 'for Model classes' do
context 'when verification state is stored in the model table' do
before(:all) do
create_dummy_model_table
......@@ -451,4 +452,17 @@ RSpec.describe Geo::VerificationState do
end
end
end
end
context 'for registry classes' do
describe '.fail_verification_timeouts' do
it 'sets verification state to failed' do
state = create(:geo_package_file_registry, :synced, verification_started_at: (described_class::VERIFICATION_TIMEOUT + 1.minute).ago, verification_state: 1)
state.class.fail_verification_timeouts
expect(state.reload.verification_failed?).to be_truthy
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment