询问者
创建AlwaysOn后只读副本无法得到查询结果?

问题
全部回复
-
Per books online:
A query on object(s) in a readable secondary database of an AlwaysOn availability group is blocked on row versioning while waiting for commit or rollback of all transactions that were in-flight when the secondary replica was enabled for read workloads. This wait type guarantees that row versions are available before execution of a query under snapshot isolation.
-
Active Secondaries: Readable Secondary Replicas (AlwaysOn Availability Groups)
As soon as a readable secondary replica joins the availability group, the secondary replica can start accepting connections to its secondary databases. However, if any active transactions exist on a primary database, row versions will not be fully available immediately on the corresponding secondary database. Any active transactions that existed on the primary replica when the secondary replica was configured must be committed or rolled back. Until this process completes, the transaction isolation level mapping on the secondary database is incomplete and queries are temporarily blocked. -
这个状态不是正常的。这个操作耗时很短。除非你的主数据库那边一直锁着。
想不想时已是想,不如不想都不想。
-
由于读操作会映射到快照隔离事务级别,因此,一个或多个辅助副本上的事务会阻止在主副本上清除虚影记录。 当辅助副本不再需要虚影记录时,虚影记录清除任务将自动清除主副本上的虚影记录。 这类似于您在主副本上运行事务时执行的操作。 在辅助数据库上的极端情况下,需要终止正在阻塞虚影清除的长时间运行的读查询。 请注意,如果辅助副本断开连接或数据移动在辅助数据库上挂起,可能阻塞虚影清除。 此状态还会阻止日志截断,因此,如果此状态持续,则我们建议您从可用性组中删除此辅助数据库。
谢谢。
准备删除重做,看是否任然存在该情况。
- 已编辑 啊甘 2016年3月17日 3:54
-