bd259f7795
Instead of writer pinning, we'll track the last transaction ID of each write in the session. Then on each read we'll wait for the replica to report that this transaction is available. If it doesn't become available within a reasonable timeout, we'll proceed anyway, and accept the possibility of a stale read. The hope here is that most of the time, the replica is caught up in the time between a write request and the following read request. If it's not, we now have a little tolerance to wait for it, which hopefully proves enough to stale reads are not encountered in normal use. We also disable the writer affinity opt-out mechanism that we had before, since we will no longer be using writer affinity at the load balancer.
19 lines
361 B
Ruby
19 lines
361 B
Ruby
class Cards::ReadingsController < ApplicationController
|
|
include CardScoped
|
|
|
|
def create
|
|
@notifications = @card.read_by(Current.user)
|
|
record_board_access
|
|
end
|
|
|
|
def destroy
|
|
@notifications = @card.unread_by(Current.user)
|
|
record_board_access
|
|
end
|
|
|
|
private
|
|
def record_board_access
|
|
@card.board.accessed_by(Current.user)
|
|
end
|
|
end
|