SóProvas


ID
17986
Banca
CESGRANRIO
Órgão
BNDES
Ano
2008
Provas
Disciplina
Banco de Dados
Assuntos

No âmbito de bancos de dados distribuídos, seja T uma transação distribuída que deve ser efetivada (commited) segundo o protocolo de compromissamento de duas fases (two-phase commit). Sobre esse assunto, assinale a afirmativa INCORRETA.

Alternativas
Comentários
  • How the System Uses a 2-Phase Commit to Commit Transactions

    A 2-phase commit is an algorithm used to ensure the integrity of a committing transaction.

    To understand how this algorithm works, consider the following sample scenario. A group of six friends wants to rent a house for a one-week vacation. No member of the group can afford to pay more than one sixth of the rent; if any of the six cannot participate, then the house cannot be rented.


    In Phase 1 of this project, the organizer of the vacation contacts each person to verify availability and collect a sixth of the rent. If the organizer learns that even one person cannot participate, she contacts every member of the group, individually, to notify him or her that the house cannot be rented. If, however, each member of the group confirms availability and pays one sixth of the rent, the Phase 1 concludes successfully.

    In Phase 2 of the project, the organizer notifies each member of the group that the vacation will take place as planned.
    A 2-phase transaction commit works in much the same way as the vacation planning project.


    In Phase 1, the transaction coordinator contacts potential participants in the transaction. The participants all agree to make the results of the transaction permanent, but do not do so immediately. The participants log information to disk to ensure they can complete Phase 2. If all the participants agree to commit, the coordinator logs that agreement and the outcome is decided. The recording of this agreement in the log ends Phase 1.

    In Phase 2, the coordinator informs each participant of the decision, and they permanently update their resources.
  •  

    Two-Phase Commit:

    Este protocolo usa um processo especial, o coordenador.

    Os processos que deverão executar as ações são os participantes:

     

    O coordenador pode ou não ser participante. Se fôr, deverá executar quer seja como protocolo do coordenador quer seja como protocolo dos participantes.

    O protocolo envolve duas fases:

     

    Na primeira fase:

    O coordenador envia uma mensagem, VOTE-REQUEST, a cada um dos participantes, e espera pela resposta de todos os participantes.
    Cada um dos participantes emite um voto: ou VOTE-COMMIT ou VOTE-ABORT.

    Na segunda fase:

    O coordenador decide COMMIT se tiver recebido VOTE-COMMIT de todos os participantes, senão decide ABORT.
    Quando recebem a decisão do coordenador, os participantes atuam de acordo executando ou não as operações, e enviam um ACK.

     

     

  •  O erro está em "onde cada nó envia sua resposta a todos os outros nós."

    Cada nó envia sua resposta apenas para o coordenador.

  • Alguem pode explicar a letra "d" e "e" ?



    Agradeceria mto. abs !  
  • REDO (X): refaz a transação; uma transação que sofreu commit antes de uma falha, mas nem todas as atualizações foram gravadas no BD. É realizado um REDO até o último commit.
    UNDO (X): desfaz a transação; uma transação que começou a executar, mas não sofreu commit antes da falha, ela então é desfeita.
  • Questão MUITO MUITO BOA.

    Primeiro vamos a definição de 2PC.

    - TWO PHASE COMMIT/ CONFIRMAÇÃO EM DUAS FASES = Garante ATOMICIDADE, garante que uma transação em um BDD faça COMMIT/ROLLBACK de maneira sincronizada (ou todos fazem COMMIT ou todos fazem ROLLBACK).

    A = Ele ta DEFININDO 2PC

    B = Se ele é o coordenador ele pode fazer isso (ROLLBACK)

    C = ELES TEM QUE ENVIAR A RESPOSTA AO COORDENADOR. RESPOSTA DE COMMIT REALIZADO OU ROLLBACK REALIZADO.

    D = Observe que aqui é o NÃO COORDENADOR, Ele se recuperou de uma FALHA mas seu LOG apresenta COMMIT ou SEJA ele tem que confirmar e deve EXECUTAR O REDO (refazer).

    E = Observe que aqui é o NÃO COORDENADOR, Ele se recuperou de uma FALHA mas seu LOG apresenta ABORT ou SEJA ele tem que ABORTAR e deve EXECUTAR O UNDO (desfazer).

    GABARITO C