Stop Cassandra Materialized View Build

情到浓时终转凉″ 提交于 2020-01-05 04:07:07

问题


Is there any way to stop the build of a materialized view in Cassandra (3.7)?

Background: I created two materialized views A and B (full disclosure - I may have attempted to drop them before the build was complete) and those views seem to be perpetually stuck...any attempt to create another view C on the same table seems to hang. Using nodetool

nodetool.viewbuildstatus <keyspace>.<view>

shows a combination of STARTED and UNKNOWN for A and B, and STARTED for views in C. Using cql:

select * from system.views_builds_in_progress

all views are listed, but generation number and last_token have not changed in the last 24hrs (generation_number is in fact null for A).


回答1:


Its not documented, but nodetool stop actually takes any compaction type, not just the ones listed (which the view build is one of). So you can simply:

nodetool stop VIEW_BUILD

Or you can hit JMX directly with the org.apache.cassandra.db:type=CompactionManager mbean's stopCompaction operation.

All thats really gonna do is set a flag for the view builder to stop on its next loop. If it threw an uncaught exception or something so its no longer doing anything (worth checking system/output logs) the stop wont do anything either. In that case its not really hurting anything though so can ignore it and retry. Worst case restart the node.



来源:https://stackoverflow.com/questions/40553499/stop-cassandra-materialized-view-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!