demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: votes and tags in the web not in synch with server Re: [Demexp-dev]


From: David MENTRE
Subject: Re: votes and tags in the web not in synch with server Re: [Demexp-dev] Question about tags, tags updating and timestamp.
Date: Sat, 14 Oct 2006 22:09:39 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

Hi,

Augustin <address@hidden> writes:

> 1) new vote on a question.
> The timestamp of a question is updated only when there is a new answer, but 
> not when there is a new vote.

Err, in fact, now the timestamp is updated after each vote (I changed
that the 8th of May).

> I cannot and will not contact the server each time someone wants to view a 
> question on the web, just to make sure that it has the proper nb of votes 
> displayed, and, what's more, the proper result.

Yes, your behaviour is correct. 

> On the web, each time someone votes, I reload the whole question, so if you 
> use the web to vote, you will see the number of votes increasing straight 
> away, and, maybe, the result change, too.
> But if someone votes with another client, I don't know it... until an answer 
> is added, or someone votes with the web. 

As a general rule, that does not matter. :-) The important thing is that
the client sees the new vote result at some point in the future, but
maybe not immediatly.

In fact, as a security measure, we will probably add some delay and
batching of vote computations to ensure that one cannot determine that a
vote is changed after an individual's vote (and thus make attacks with
that information).

> 2) new tags on a question.
> Similarly, I am not sure but it seems that the timestamp of a question is not 
> updated if one or more tags are attached to it, or if a tag has changed 
> description. 

No, the timestamp is updated after tagging/untagging:

let tag_question (cookie, q_id, tag_id) =
  log "RPC tag_question(@[%d,@ %d,@ address@hidden)" cookie q_id tag_id;
  do_if_classifier cookie
    (fun () ->
      try
        Classification.tag_question ~q_id ~tag_id;
        Posbase.update_timestamp ~q_id;

However, timestamp table computation is only done at intervals of 2
minutes, to avoid a CPU Denial of Service attack by requesting too many
times this table. So that might explain why you don't see the timestamp
updated.

> But otherwise, I don't know of any incoming new tags, so the questions on the 
> web will not be accurately tagged.

If the tagging of question have changed, the question timestamp is updated.

> 3) When a tag is updated (the label changes), is there a method to have the 
> list of all the questions which have this tag?

No. This is computed on the hard client (and maybe it was on my own web
one).

That might change in the future if needed.


On those tagging issues, I would have following approach:

 * build or recompute a tagging data structure once in a while,
   e.g. each hour or 4 hours;

 * use this data structure to build navigation indexes and tagging info
   on questions.

More generally, the client should *not* try to contact the server to
have latest information, except when absolutely needed (e.g. list of all
responses for a vote). In a system with many actions taking place
simultaneously, one could expect some inconcistencies.

I hope I'm clear (not so sure ;-),
Best wishes,
d.
-- 
GPG/PGP key: A3AD7A2A David MENTRE <address@hidden>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A




reply via email to

[Prev in Thread] Current Thread [Next in Thread]